Results 1 to 2 of 2

Thread: ToolBar shortcuts don't work when QToolBar is hidden

  1. #1
    Join Date
    Jun 2012
    Thanked 3 Times in 3 Posts
    Qt products

    Default ToolBar shortcuts don't work when QToolBar is hidden

    I've defined shortcuts for the QActions in the Mainwindow toolbar. They work fine when the ToolBar is visible.

    But, to maximize screen real estate, I hide the MenuBar and ToolBar except when the mouse pointer is over the top of the MainWindow screen. The user can hover over the menubar or toolbar to unhide it, then click on an icon or menubar item. But normally they will prefer to type a key on a tiny keyboard.

    I've tried changing the QAction, shortcut context to to Application, but this has no effect.

    I created the shortcuts in QtDesigner. Do I instead need to create the short cuts in code and separately connect them to slots that are now associated with ToolBar QActions?

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: ToolBar shortcuts don't work when QToolBar is hidden

    Add the actions from the toolbar to your window widget (using QWidget::addAction).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

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

    davethomaspilot (17th September 2018)

Similar Threads

  1. Keybord shortcuts for hidden widgets / actions
    By Scope in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2016, 08:44
  2. QToolBar: customize toolbar
    By San_Cou in forum Newbie
    Replies: 1
    Last Post: 20th December 2012, 15:47
  3. Replies: 5
    Last Post: 6th November 2012, 20:42
  4. Replies: 2
    Last Post: 21st September 2010, 08:32
  5. ToolBar icons hidden in windows
    By giusepped in forum Installation and Deployment
    Replies: 3
    Last Post: 13th January 2009, 15:56

Tags for this Thread


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.