Results 1 to 3 of 3

Thread: WidgetWithChildrenShortcut not working?

  1. #1
    Join Date
    Apr 2011
    Location
    USA
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default WidgetWithChildrenShortcut not working?

    I'm trying to set up shortcuts for some actions in a context menu for a widget I have several instances of. This means that each widget is going to have the same (duplicate, actually) actions and same shortcuts, and the action should apply to the widget that has focus, so WindowShortcut is out.

    Since the widget is a compound widget with a .ui (and I am hoping to define the actions in the .ui), I'm really hoping to be able to use WidgetWithChildrenShortcut rather than just WidgetShortcut, but for the life of me I can't get it to work.

    Example .ui attached. Now, as far as I know, the action is owned by the QMainWindow, which means that WindowShortcut and WidgetWithChildrenShortcut should be effectively equivalent in this case, but I can't trigger the action by shortcut.

    Anyone know what I am doing wrong?

    I am using qt-4.7.2-8.fc14.x86_64
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2010
    Location
    Egypt
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: WidgetWithChildrenShortcut not working?

    i will check it

  3. #3
    Join Date
    Apr 2011
    Location
    USA
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default SOLVED: WidgetWithChildrenShortcut not working?

    So... interestingly, polto2010 (thanks for the help ) says the .ui example works on OS-X.

    Anyway, I think I finally figured it out. It seems that the widget for which the action will be triggered if that widget or its children have focus is NOT the parent of the QAction, but any (and all?) widget(s) to which the action has been added by QWidget::addAction.

    IOW this might never work as a pure-.ui example... BUT I can get it working in my application.

Similar Threads

  1. This SLOT is not working...
    By icx in forum Newbie
    Replies: 1
    Last Post: 17th August 2010, 21:18
  2. MVC example not working
    By yyiu002 in forum Newbie
    Replies: 1
    Last Post: 30th June 2010, 00:07
  3. My first app not working
    By Noks in forum Newbie
    Replies: 6
    Last Post: 2nd February 2010, 16:34
  4. QT (not-) working with VTK libraries
    By floyd.pepper in forum Newbie
    Replies: 16
    Last Post: 31st August 2009, 12:46
  5. Mac OS X UI not working
    By hvengel in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2006, 01:02

Tags for this Thread

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.