[Interest] QDockWidgets and ambiguous QShortcuts

Felix morack felixover at gmail.com
Sun May 29 10:21:36 CEST 2016


Hi,

I'm facing the following problem with Shotcuts (QShortcut) and docking
widgets (QDockWidget).

I have a custom widget that is contained in a QDockWidget, in its ctor I
register some keyboard shortcuts. As long as I have only one docking widget
of this type all is fine, but when I have two or more the
QShortcut::activated signal is not fired. Instead, the
QShortcut::activatedAmbigiuouslysignal is fired.


I dont know why though - the Shortcut is not ambiguous. If I register an
event filter or override the eventFIlter method in my widget the keypress
event is delivered correctly - and only once. (Ironically because of this
my application works just fine if I connect both the actiavted and the
actiavedAmbiguously signals to my slot...)


Might this be a bug or a shortcoming in the QDockWidget subsystem?


What has me baffled is that Qt's widgets (e.g. QLineEdit) have no problems
with their keyboard shortcuts (copy, paste, etc.).


regards

p.s. The same problem exists if I create a QAction with a Shortcut and add
it to my widgte with addAction().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160529/189dff91/attachment.html>


More information about the Interest mailing list