Displaying MainWindow text in a Dialog
-
Hi, I have a mainwindow with a lineEdit and a pushButton and a Dialog which has a Label.
When I click the pushButton, I open the Dialog.
My goal is that, when the pushbutton is clicked, the text contained in the lineEdit is displayed in the Label.
How can I do that? -
Hi, I have a mainwindow with a lineEdit and a pushButton and a Dialog which has a Label.
When I click the pushButton, I open the Dialog.
My goal is that, when the pushbutton is clicked, the text contained in the lineEdit is displayed in the Label.
How can I do that?@Davide00 Get the text from the line edit using https://doc.qt.io/qt-6/qlineedit.html#text-prop
Implement in your dialog either a setting method to set the text and call it and pass text from the line edit. Or add QString parameter to the constructor of your dialog and pass line edit text to it.
https://doc.qt.io/qt-6/qlabel.html#text-prop