开发者

how to write and read a text to and from a LineEdit using QT Creator?

开发者 https://www.devze.com 2023-03-20 12:42 出处:网络
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

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 t开发者_JS百科hat 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消