mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
10 lines
344 B
Python
10 lines
344 B
Python
from PyQt5.QtWidgets import QWidget, QApplication
|
|
|
|
|
|
def centralize(widget: QWidget):
|
|
geo = widget.frameGeometry()
|
|
screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
|
|
center_point = QApplication.desktop().screenGeometry(screen).center()
|
|
geo.moveCenter(center_point)
|
|
widget.move(geo.topLeft())
|