Dateien zu Teil 29
This commit is contained in:
30
teil29/sizewindow.py
Executable file
30
teil29/sizewindow.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#! /usr/bin/python
|
||||
# Datei: sizewindow.py
|
||||
|
||||
import sys
|
||||
from PyQt6.QtCore import QSize, Qt
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton
|
||||
|
||||
|
||||
# abgeleitet von QMainWindow können wir unser GUI besser einstellen und
|
||||
# z.B. die Dimensionen des Fensters ändern.
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.setWindowTitle("Fenstergröße")
|
||||
|
||||
button = QPushButton("Bitte klicken")
|
||||
|
||||
self.setFixedSize(QSize(400, 300))
|
||||
|
||||
# der Button sitzt als zentrales Widget im Fenster.
|
||||
self.setCentralWidget(button)
|
||||
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
app.exec()
|
Reference in New Issue
Block a user