In the slot connected to textChanged() that I mentioned in my previous post, call toPlainText().isEmpty() on your QPlainTextEdit to know whether its text is empty, then setEnabled() on the button as needed.
In the slot connected to textChanged() that I mentioned in my previous post, call toPlainText().isEmpty() on your QPlainTextEdit to know whether its text is empty, then setEnabled() on the button as needed.
But to do that I need an additional method and two pointers to QPlainTextEdit and QPushButton, because I create a QDialog in the method of the main form, right? Otherwise can not be?
Indeed.
In any case, creating a form that way is not very common, best practise is to create a subclass of, in this case QDialog, and encapsulate all its internals into that class.
That way the user of the dialog/form only deals with the class' public API, independent on how it is actually implemented internally.
Cheers,
_
Ok, thanks.
Bookmarks