updating a pySide6 label with each keystroke
I have a beginner exercise where I need to make a label that shows the input text, but in uppercase. I tried to create a function with the same name, before I realized setText was a built-in function. I have no idea how to make it work properly. import sys from PySide6.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QVBoxLayout, QWidget class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("ALL CAPS") layout = QVBoxLayout() self.input = QLineEdit() self.label = QLabel("") self.input.textChanged.connect(self.label.setText) layout.addWidget(self
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.