Dateien zu Teil 29
This commit is contained in:
30
teil29/handleButton.py
Executable file
30
teil29/handleButton.py
Executable 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()
|
Reference in New Issue
Block a user