From 8b447c240cbb3a73d30e7d858ec062538bfccc84 Mon Sep 17 00:00:00 2001 From: Toast Date: Sun, 20 Oct 2024 01:09:41 +0200 Subject: [PATCH] Make my own main window --- src/leek/leek.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/leek/leek.py b/src/leek/leek.py index 0fc9342..5151951 100644 --- a/src/leek/leek.py +++ b/src/leek/leek.py @@ -1,13 +1,31 @@ -from PySide6.QtWidgets import QApplication, QWidget import sys +from PySide6.QtCore import QSize, Qt +from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton + + +# Subclass QMainWindow to customize your application's main window +class leekMainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle("Leek!") + + button = QPushButton("Press Me!") + + self.setMaximumSize(QSize(800,600)) + self.setMinimumSize(QSize(400,300)) + + # Set the central widget of the Window. + self.setCentralWidget(button) + def main(): # If you know you won't use command line arguments QApplication([]) works too. app = QApplication(sys.argv) # Create a Qt widget, which will be our window. - window = QWidget() + window = leekMainWindow() window.show() # IMPORTANT!!!!! Windows are hidden by default. # Start the event loop.