Advertisement
stuppid_bot

PyQt: how center window

Dec 21st, 2014
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def center_window(w):
  2.     from PyQt4 import QtGui
  3.     d = QtGui.QApplication.desktop()
  4.     s = w.size()
  5.     w.move((d.width() - s.width()) / 2, (d.height() - s.height()) / 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement