Hi, I'm trying to connect one signal with one slot but I can't find the problem. Where can it be?
QHash<int, QString>::const_iterator it = m_miHashTable.constBegin();
while (it != miHashTable.constEnd())
{
QAction* action
= menu
->addAction
(nameSubmenu
);
bool pleaseWork
= QObject::connect(action,
SIGNAL(QAction::triggered(bool)), action,
SLOT(setVisible
(bool)));
it++;
}
QMenu* menu = new QMenu();
QHash<int, QString>::const_iterator it = m_miHashTable.constBegin();
while (it != miHashTable.constEnd())
{
QString nameSubmenu = it.value();
QAction* action = menu->addAction(nameSubmenu );
bool pleaseWork = QObject::connect(action, SIGNAL(QAction::triggered(bool)), action, SLOT(setVisible(bool)));
it++;
}
To copy to clipboard, switch view to plain text mode
"pleaseWork" is always false (I use to set the breakpoint at it++), I've tried with this slot (it should work because it's a QT default slot...) and with functions declared as private, other declared as private slot, with or without parameters... any hint?
thanks!
Bookmarks