Я не понимаю, почему по умолчанию QDialog
находится в центре, а QMainWindow
в верхнем левом углу?
Пример кода:
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QDialog
class MainWindow(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("MainWindow")
class Dialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Dialog")
if __name__ == "__main__":
app = QApplication(sys.argv)
main_window = MainWindow()
main_window.show()
dialog = Dialog()
dialog.show()
sys.exit(app.exec_())
Я бы предпочел QMainWindow
в центральной позиции по умолчанию.