First of all hello to everyone. Im still new to Qt but getting better
And now to my question.. i have a QLineEdit widget which must not be empty when user clicks a certain button. So i wrote this:
if (serverAddress.text().trim()!= "" && serverAddress.text().trim() != null) {
serverNameValid = true;
}else {
errorMessage += "\nServer name cannot be empty!";
}
if (serverAddress.text().trim()!= "" && serverAddress.text().trim() != null) {
serverNameValid = true;
}else {
errorMessage += "\nServer name cannot be empty!";
}
To copy to clipboard, switch view to plain text mode
Simple enough right? But the problem is.. it doesnt work! text() method never returns an empty string even if the QLineEdit widget is empty! Is there anything i missed?
Thanks for your reply
edit: I apologize if I shouldnt post Jambi stuff here but didnt see any other appropriate forum.
Bookmarks