Qt::Drawer blocks QMainWindow keyboard shortcuts
I have an app that constructs a QMainWidow with a QDockWidget configured to be MacOSX drawer widget using the Qt::Drawer window flag. In the QMainWindow I have a QToolBar containing a number of QAction's all of which have keyboard shortcuts associated with them. These shortcuts all work fine until I attach the QDockWidget at which point the actions no longer respond. They can be clicked on, they just don't respond to the keyboard shortcuts. If the QDockWidget is not attached, they work fine. If the QDockWidget is not configured to be a drawer, they work fine. I'm just wondering if anybody else has had this issue and can tell me if I'm doing something wrong or if this is a bug. Either way a solution/work around would be much appreciated.
The following is a small example illustrating the problem:
QT += core gui
TARGET = Drawers
TEMPLATE = app
SOURCES += main.cpp
HEADERS += mainwindow.h
class MainWindow : public QMainWindow
explicit MainWindow(QWidget *parent = 0);
#endif // MAINWINDOW_H
MainWindow::MainWindow(QWidget *parent) :
QAction *action=new QAction("Action", this);
// Commenting out the following two lines or removing // the Qt::Drawer window flag removes the problem QDockWidget *dw=new QDockWidget("", this, Qt::Drawer); addDockWidget(Qt::LeftDockWidgetArea, dw);
int main(int argc, char *argv)
QApplication a(argc, argv);
All help and/or suggestions greatly appreciated :o)
Which Qt/OS X combo are you using ?
MacOSX 10.8.5 with Qt4.8.
Looks like you are hitting this "bug":https://bugreports.qt-project.org/browse/QTBUG-26282
I'd recommend re-opening it with your findings