Hi, I'm trying to connect one signal with one slot but I can't find the problem. Where can it be?


Qt Code:
  1. QMenu* menu = new QMenu();
  2.  
  3. QHash<int, QString>::const_iterator it = m_miHashTable.constBegin();
  4. while (it != miHashTable.constEnd())
  5. {
  6. QString nameSubmenu = it.value();
  7. QAction* action = menu->addAction(nameSubmenu );
  8.  
  9. bool pleaseWork = QObject::connect(action, SIGNAL(QAction::triggered(bool)), action, SLOT(setVisible(bool)));
  10. it++;
  11. }
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!