Hello!
I have some QToolButton widgets on my QDialog. I want to use common slot to process clicked() signal. How can I know wich one of the QToolButton was clicked?
Hello!
I have some QToolButton widgets on my QDialog. I want to use common slot to process clicked() signal. How can I know wich one of the QToolButton was clicked?
u have connectio (blabla, SIGNAL(clicked()),SLOT(slot()))
void ClassName::slot()
{
QToolButton* tb = qobject_cast<QToolButton*>(sender());
if (tb)
{
do something with current toolbutton
}
}
Opilki_Inside (27th March 2006)
Thanks! It works fine!Originally Posted by evgenM
You could also use a QButtonGroup..
In this case it's more "elegant" to use QButtonGroup assigning an identificator for each icon.
Bookmarks