Skip to content

Instantly share code, notes, and snippets.

@Cysu
Created November 22, 2013 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Cysu/7596046 to your computer and use it in GitHub Desktop.
Save Cysu/7596046 to your computer and use it in GitHub Desktop.
Python: PyQt- Move widget to center
fg = self.frameGeometry()
cp = QtGui.QDesktopWidget().availableGeometry().center()
fg.moveCenter(cp)
self.move(fg.topLeft())
@seghier
Copy link

seghier commented Sep 30, 2017

this move the widget and the parent window to the center of the screen

@Ahmed-Salama96
Copy link

Thanks, this helped me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment