1 Attachment(s)
dockable widgets (in mainwindow) with common shortcut not working
Hi,
It seems that if more than one dockwidgets are shown in main window then the shortcut set for the dockwidget's pushbutton is not working.
Pl. find the attached dockwidgets.tar.gz qt-example program, here I have attached "Esc" key to close button of both 'Customers' and 'Paragraphs' dockwidgets.
Here I want to dismiss the docked widget when I press the "Esc" key. This is working fine if one dock widget is shown (and also when dock widgets are undocked from the mainwindow) but fails if two dockwidgets are shown in mainwindow.
Thank you.
Re: dockable widgets (in mainwindow) with common shortcut not working
Any suggestion please.
Thank you.
Re: dockable widgets (in mainwindow) with common shortcut not working
It's because qt doesn't know which dock widget it should close(if dockwidgets are undocked shortcut for dockwidget with focus is activated and if you have only one widget visible there's also no shortcuts conflict).
You should set some global 'esc' shortcut (see QShortcut) and close dockwidgets with some priority there(if more that one are visible and docked to same main window), or see QShortcut::activatedAmbiguously () signal or QShortcutEvent.