Dateien zu Teil 29
This commit is contained in:
36
teil29/lineedit.py
Executable file
36
teil29/lineedit.py
Executable file
@@ -0,0 +1,36 @@
|
||||
#! /usr/bin/python
|
||||
#Datei: lineEdit.py
|
||||
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QVBoxLayout, QWidget
|
||||
import sys
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.setWindowTitle("Eingabe mit LineEdit")
|
||||
|
||||
self.label = QLabel()
|
||||
|
||||
self.input = QLineEdit()
|
||||
self.input.textChanged.connect(self.label.setText)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.addWidget(self.input)
|
||||
layout.addWidget(self.label)
|
||||
|
||||
container = QWidget()
|
||||
container.setLayout(layout)
|
||||
|
||||
# Set the central widget of the Window.
|
||||
self.setCentralWidget(container)
|
||||
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
app.exec()
|
||||
|
Reference in New Issue
Block a user