Many Buttons but same process
-
Hi All,
At my project there are many QPushButton object at one page, I want to assign a ID to all push buttons and collect all slots at the same slot. But I have to realise which button is pressed on the slot function is there an easy way to achive it or should I have to write a fuction call to all buttons?
Thanks...
-
Hi,
You're likely looking for QSignalMapper
-
No you don't, you only have to add some C++ code in your current widget to use that class.
-
Hi All,
Who want's to use QSignalMapper with Qdesigner can add this code to initial of the class...
TheMapper = new QSignalMapper(this);
connect(TheMapper,SIGNAL(mapped(int)) , this,SLOT(GetCompProperties(int)));
ui->vlfAlt_Cikis->connect(ui->vlfAlt_Cikis,SIGNAL(pressed()),TheMapper,SLOT(map()))
TheMapper->setMapping(ui->vlfAlt_Cikis,1);//ui->vlfAlt_Cikis is a QPushButton...
thanks @SGaist ...