added main.py
This commit is contained in:
26
main.py
Normal file
26
main.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
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()
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user