How I can center window on active screen but not on general screen? This code moves window to center on general screen, not active screen:
import sys from Py
The other answers worked with a few deprecated warnings when using PySide2. So here is my version of the same function:
def center(self): screen = QtGui.QGuiApplication.screenAt(QtGui.QCursor().pos()) fg = self.frameGeometry() fg.moveCenter(screen.geometry().center()) self.move(fg.topLeft())