I want to prevent a connection between a ui object signal and a slot from occurring if there is already an existing connection.
I can't use Qt::UniqueConnection due to only being able to use 4.5.x, and I can't use QObject::receivers() as a condition in an if statement because it is a protected function.
//doesn't work as protected
if(ui.comboBox->receivers(SIGNAL(currentIndexChanged(int)))
QObject::connect(ui.
comboBox,
SIGNAL(currentIndexChanged
(int)),
this,
SLOT(comboBoxchanged
(int)))
//doesn't work as protected
if(ui.comboBox->receivers(SIGNAL(currentIndexChanged(int)))
QObject::connect(ui.comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(comboBoxchanged(int)))
To copy to clipboard, switch view to plain text mode
Any ideas how I could I would be able to check for duplicate connections for these ui objects?
Bookmarks