Hello,
I'm newbie at Qt.
I want to control line edit to understand it is empty or not, when a push button is pressed. How can I implemet it ?
Best regards....
Hello,
I'm newbie at Qt.
I want to control line edit to understand it is empty or not, when a push button is pressed. How can I implemet it ?
Best regards....
Hello!!
From line edits you can take the text by using QLineEdit::text(). Once you done that, you will receive a http://doc.qt.io/qt-4.8/QString, which has the isEmpty method.
Take a look:
Qt Code:
if(le->text().isEmpty()){ //no text inside... Or only spaces }else{ //some valid non-space text inside. }To copy to clipboard, switch view to plain text mode
HTH.
Bookmarks