how to write and read a text to and from a LineEdit using QT Creator?
You use QLineEdit::setText()
to change the text and QLineEdit::text()
to read.
Your questions are very basic and show a clear lack of studying the documentation and experimenting thing yourself. Qt is one of the better documented frameworks out there and with lots of examples. Please take your time to go through them.
skywak
Updated on August 19, 2020Comments
-
skywak over 3 years
I am working with QT Creator. I have a form that contains a push button and an Line Edit. I would like to print a string that i give programatically in this LineEdit.Secondly I would also like to the from the LineBox a string that I fill in and print it using QMessageBox.
How to do it? Need some help. I don't know how to access the displayText() to write and read from a LineEdit.
I would like to specify that I put the push button and the lineedit on the Form using drag and drop.
I am working in c++ under Ubuntu Appreciate.
-
skywak almost 13 yearsCan you please give me a good link from where I can start reading QT tools? I am new to this program. THX
-
Vinicius Kamakura almost 13 yearsdeveloper.qt.nokia.com/resources, there is a whole Getting Started section.
-
ssell almost 13 yearsDon't get confused by the Qt Tools. Creator is simply an IDE like any other that is simply tailored to Qt development, and Designer is a WYSIWYG editor.
-
Sigur almost 6 years@ViniciusKamakura, do you have a reference how to read lines from
txt
and fill manyQLineEdit
s? I mean, supposetxt
with 2 lines:faa
andfoo
. I'd like to setfoo
toQLineEdit_1
andfaa
toQLineEdit_2
.