Why not do something like this?
connect(serverAddress,
SIGNAL(textChanged
(const QString &)),
this,
SLOT(check
(const QString &)));
void myClass
::check(const QString &str
){ button->setEnabled(!str.isEmpty());
}
connect(serverAddress, SIGNAL(textChanged(const QString &)), this, SLOT(check(const QString &)));
void myClass::check(const QString &str){
button->setEnabled(!str.isEmpty());
}
To copy to clipboard, switch view to plain text mode
It's C++ code, but it's very simple so you should have no trouble translating it to Java. Oh, and check() has to be a slot, of course.
Bookmarks