Я хочу получить геометрию окна PyQt 6: [code]import sys from PyQt6.QtWidgets import QApplication, QVBoxLayout, QPushButton, QWidget from PyQt6.QtCore import QTimer
def print_geometry(self): print(self.geometry()) # This will now print the correct geometry
if __name__ == '__main__': app = QApplication(sys.argv) win = MainWindow() sys.exit(app.exec()) [/code] Проблема в том, что позиции x и y всегда равны 0 даже после того, как я изменил положение окна на экране: [code]PyQt6.QtCore.QRect(0, 0, 200, 300) PyQt6.QtCore.QRect(0, 0, 200, 300) PyQt6.QtCore.QRect(0, 0, 200, 300) PyQt6.QtCore.QRect(0, 0, 200, 300) [/code] Я не знаю, почему он возвращает 0 для позиций x и y. Он должен был вернуть точную позицию. [list] [*]ОС: Ubuntu [*]Версия Python: 3.9 [/list]