简体   繁体   English

选择PyQt4 QWidget窗口的打开位置

[英]Choose Opening Location of PyQt4 QWidget window

My main application has a button that pops up a new smaller window in front of my application, and I want to change the location of where the new window opens. 我的主应用程序有一个按钮,它会在应用程序前面弹出一个新的较小窗口,并且我想更改新窗口打开位置。

Currently the code to show the window is simply: 当前显示窗口的代码很简单:

self.my_window.show()

where my_window is an instance of my QWidget Class. 其中my_window是我的QWidget类的实例。

How do I choose the coordinates of where the window opens in Windows OS? 如何在Windows OS中选择窗口打开位置的坐标?

self.my_window.move(x_coord, y_coord)

其中x_coordy_coord为整数

您必须使用move()

 {your widget}.move({x}, {y})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM