On Thu, Aug 30, 2012 at 11:37 PM, Python.py <dsishim...@gmail.com> wrote: > I'm trying to get my application when run, appear in the middle of the > screen. Whenever it starts at the top right. Someone can tell me how can I > do to always leave sentralizado? I'm using QWidget, tried to use in function
Hi, I am not aware of Center() function, but using the following snippet any widget can be easily centered. from PyQt4 import Qt as qt def center_widget(w): d = qt.QApplication.desktop() screen_w = d.width() screen_h = d.height() widget_w = w.width() widget_h = w.height() x = (screen_w - widget_w) / 2 y = (screen_h - widget_h) /2 w.move(x, y) if __name__ == '__main__': app = qt.QApplication([]) win = qt.QWidget() win.show() center_widget(win) app.exec_() regards. Cihangir Akturk _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt