setBuddy in QFormLayout() doesn't work - why?
Unsolved
Qt for Python
-
Hello,
I want to link a QLabel with a QTextEdit() and I tried this:layout = QFormLayout() label_commando = QLabel("Command:") self.text_edit = QTextEdit() label_commando.setBuddy(self.text_edit)
When I click on the QLabel with the computer mouse, the QTextEdit() doesn't get the input focus, why?
-
The buddy mechanism is intended for keyboard shortcuts; see https://doc.qt.io/qt-6/qlabel.html#setBuddy .
-
Thank you. Here there is a big difference between web programming and Qt programming. Thats how it works:
label_command = QLabel("&command:") self.text_edit = QTextEdit() label_commando.setBuddy(self.text_edit)