Make my own main window
This commit is contained in:
parent
3d8667781d
commit
8b447c240c
1 changed files with 20 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue