Re: Dynamic object's method.
Sure, connect the QPlainTextEdit's textChanged() signal to a custom slot where you put your code. You should learn basics about signals and slots and widget applications first.
Re: Dynamic object's method.
Yes, but I would like to do if QPlainTextEdit->toPlainText() return empty string, ok button is disabled else it is enabled. I can use signals and slots, but I didn't know how do that in this case.
Re: Dynamic object's method.
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.
Re: Dynamic object's method.
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?
Re: Dynamic object's method.
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,
_
Re: Dynamic object's method.