Retrieving the text from QLineEdit
-
I want to retrieve the entered text from QLineEdit and put it into a variable
QString name;
My question is what is the proper code to perform this action? -
You use the "text" method.
@QString name = ui->lineEdit->text();@Refer to the QLineEdit documentation to see its members and information:
http://qt-project.org/doc/qt-5/qlineedit.html -
You can retrieve the input with "text()":http://qt-project.org/doc/qt-5/qlineedit.html#text-prop
However, you might to checkout the "tutorials and examples":http://qt-project.org/doc/qt-5/qtexamplesandtutorials.html for more details on the different ways to use QLineEdit