Dateien zu Teil 29

This commit is contained in:
Olli Graf
2025-02-16 14:39:34 +01:00
parent 6db74b04f5
commit 4d2b58b744
10 changed files with 245 additions and 0 deletions

30
teil29/handleButton.py Executable file
View File

@@ -0,0 +1,30 @@
#! /usr/bin/python
#Datei: handleButton.py
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Button Signal")
button = QPushButton("Bitte klicken")
button.setCheckable(True)
button.clicked.connect(self.handle_button_click)
# Set the central widget of the Window.
self.setCentralWidget(button)
def handle_button_click(self):
print("Button geklickt")
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()