When I .show()
an dialog it usually shows up a little to the left, I have no idea why. I wanted to center all my opened dialogs so i used:
qr = dlgNew.frameGeometry()
cp = QtGui.QDesktopWidget().availableGeometry().center()
qr.moveCenter(cp)
dlgNew.move(qr.topLeft())
and also:
sG = QtGui.QApplication.desktop().screenGeometry()
x = (sG.width()-dlgMain.width()) / 2
y = (sG.height()-dlgMain.height()) / 2
dlgMain.move(x,y)
dlgMain.show()
My question is, which is proper/better way to use, and what is the difference?