[Solved] Preventing keyboard focus going to QWidget::createWindowContainer widgets
-
I realize this is 5.1+ so if there's a better place to ask this, please let me know.
I've tried
@container->setFocusPolicy(Qt::NoFocus);@I've tried (where parent has the keyboard behavior I want)
@container->installEventFilter(parent);@And even (where view is the QQuickView being embedded by createWindowContainer)
@view->setKeyboardGrabEnabled(false);@But it still hogs focus. Any ideas?
-
you could try to reimplement "QWidget::focusNextPrevChild()":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#focusNextPrevChild and simply return true.
But i'm not sure if it will help you in this case. -
Postmortem:
I fixed this by installing an eventfilter