Hi,

I have a toggle action that should call a function within my class when toggled.
However, it does not, and I have no idea why not.

Could someone please take a look?

In my widget constructor:
Qt Code:
  1. ...
  2. QAction *topmostAction = new QAction("Stay on &Top", this);
  3. topmostAction->setShortcut(QKeySequence("Ctrl+T"));
  4. topmostAction->setCheckable(true);
  5. topmostAction->setChecked(false);
  6. connect(topmostAction, SIGNAL(toggled(bool)),
  7. this, SLOT(setTopmost(bool)));
  8.  
  9. addAction(topmostAction);
  10. ...
To copy to clipboard, switch view to plain text mode 

and later on the function that should be called:

Qt Code:
  1. void OvenTimerWidget::setTopmost(bool bTopmost)
  2. {
  3. Qt::WindowFlags flags;
  4.  
  5. flags = windowFlags();
  6.  
  7. if (bTopmost)
  8. flags |= Qt::WindowStaysOnTopHint;
  9. else
  10. flags &= (!Qt::WindowStaysOnTopHint);
  11.  
  12. setWindowFlags(flags);
  13.  
  14. emit topmostChanged(bTopmost);
  15. }
To copy to clipboard, switch view to plain text mode 

I have my breakpoint in there, click on the (context) menu entry, it gets checked, but I never reach the breakpoint. What could be wrong here?

Thanks!