no ideas anyone?
no ideas anyone?
Do you get a message on the console if you click the shortcut multiple times saying that the shortcut ambiguous?
By the way its really hard to image what you are doing without real code (or at least a shortcut)
i use the following shortcuts:
shortcut_esc = new QShortcut(this);
shortcut_esc->setKey(Qt::Key_Escape);
connect(shortcut_esc,SIGNAL(activated ()),PlayerExtraScreen::instance(),SLOT( showListView() ));
shortcut_pgup = new QShortcut(this);
shortcut_pgup->setKey(Qt::Key_PageUp);
connect(shortcut_pgup,SIGNAL(activated ()),this,SLOT( backItem() ));
connect(shortcut_pgup,SIGNAL(activatedAmbiguously ()),this,SLOT( backItem() ));
shortcut_pgdown = new QShortcut(this);
shortcut_pgdown->setKey(Qt::Key_PageDown);
connect(shortcut_pgdown,SIGNAL(activated ()),this,SLOT( nextItem() ));
connect(shortcut_pgdown,SIGNAL(activatedAmbiguousl y()),this,SLOT( nextItem() ));
as you can see a also use the Ambigously Signal for testing. but the shortcvut is not ambiuge, i already checked that.
it seems the the key-pressed event is 'swallowed' by an other widget (cause of the fakt that after i clicked somewhere in the app, the shortcut works).
and that is the point wich i do not understand:
the widget is the active widget (the one with the focus) - so why does it get the key event one the first way and not on the second. there must be something beside the attribut 'hasFocus' that the shortcut depends on. what else can it be???? please help
What is "this" in the QShortcut Contstructor?
the code snipped is part of the constructor of the detailview class, whitch is the parent of the shortcut.
so the 'this' pointer is ther instance of the detailview containing the shortcut
Bookmarks