Results 1 to 4 of 4

Thread: Shift+F1 only works if a QWhatsThis action has been added to the menu/toolbar

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Shift+F1 only works if a QWhatsThis action has been added to the menu/toolbar

    You were right, it doesn't work. I made it work this way:

    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3. #include <QAction>
    4. #include <QKeySequence>
    5.  
    6. int main(int argc, char **argv){
    7. QApplication app(argc, argv);
    8. QAction act("quit", &w);
    9. act.connect(&act, SIGNAL(triggered()), &w, SLOT(close()));
    10. act.setShortcut(QKeySequence(Qt::Key_Escape));
    11. w.addAction(&act); // this here does the trick
    12. w.show();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to wysota for this useful post:

    momesana (1st October 2006)

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
  •  
Qt is a trademark of The Qt Company.