Yes, what i said remains valid, but in your particular case you don't pass anything - because the clicked signal has void parameters and if the slot (member function) has default arguments (void setTxt(QString txt = "hi!"); ) so it can be called with void parameter ( just setTxt() ) - and it will just use the default value.
So the connect statement will be:
QObject::connect(btn,
SIGNAL(clicked
()), btn,
SLOT(setTxt
()));
//no QString here (it will use the default)
QObject::connect(btn, SIGNAL(clicked()), btn, SLOT(setTxt())); //no QString here (it will use the default)
To copy to clipboard, switch view to plain text mode
//Read the documentation for signal and slots (i gave you a link in my first post)
LE: Also the setTxt slot should not emit clicked signal (you end up with an infinite loop) so delete/comment the line: emit clicked(); from void mybtn::setTxt(QString txt) {...}
Bookmarks