Results 1 to 2 of 2

Thread: I failed to catch QMenu triggered signal, is it even possible?

  1. #1
    Join Date
    Nov 2007
    Location
    Lithuania
    Posts
    16
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default I failed to catch QMenu triggered signal, is it even possible?

    Signals are only accesible through menu bar sub-menu, I am creating little program and I can't do one-click "About" button on Menu Bar without sub-menus.

    Where problem could be?

    It is working:
    Qt Code:
    1. void MainWindowImpl::on_actionCh_triggered()
    2. {
    3. qDebug("just for test...");
    4. }
    To copy to clipboard, switch view to plain text mode 

    Non-working:
    Qt Code:
    1. void MainWindowImpl::on_menuChh_triggered()
    2. {
    3. qDebug("just for test...");
    4. }
    To copy to clipboard, switch view to plain text mode 

    QAction inherits QMenu, and triggered signal exists for both classes.
    Last edited by wysota; 29th February 2008 at 23:00. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I failed to catch QMenu triggered signal, is it even possible?

    QMenuBar inherits QWidget and not QMenu thus it doesn't emit anything when a menu is chosen (only when an action from a menu is).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.