27 lines
541 B
Python
27 lines
541 B
Python
from PyQt6.QtCore import QSize
|
|
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton
|
|
|
|
import sys
|
|
|
|
class MainWindow(QMainWindow):
|
|
def __init__(self):
|
|
super().__init__()
|
|
|
|
self.setWindowTitle("Hello World")
|
|
button = QPushButton("Click Me!")
|
|
|
|
self.setMinimumSize(QSize(200, 100))
|
|
self.setMaximumSize(QSize(900, 800))
|
|
|
|
self.setCentralWidget(button)
|
|
|
|
app = QApplication(sys.argv)
|
|
|
|
window = MainWindow()
|
|
window.show() # windows are hidden by default
|
|
|
|
# start event loop
|
|
app.exec()
|
|
|
|
|