diff options
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 5d8bce5..0af1070 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1007,10 +1007,10 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg void QGraphicsViewPrivate::updateInputMethodSensitivity() { Q_Q(QGraphicsView); - q->setAttribute( - Qt::WA_InputMethodEnabled, - scene && scene->focusItem() - && scene->focusItem()->flags() & QGraphicsItem::ItemAcceptsInputMethod); + bool enabled = scene && scene->focusItem() + && (scene->focusItem()->flags() & QGraphicsItem::ItemAcceptsInputMethod); + q->setAttribute(Qt::WA_InputMethodEnabled, enabled); + q->viewport()->setAttribute(Qt::WA_InputMethodEnabled, enabled); } /*! @@ -1022,16 +1022,8 @@ QGraphicsView::QGraphicsView(QWidget *parent) setViewport(0); setAcceptDrops(true); setBackgroundRole(QPalette::Base); - - // ### Ideally this would be enabled/disabled depending on whether any - // widgets in the current scene enabled input methods. We could do that - // using a simple reference count. The same goes for acceptDrops and mouse - // tracking. + // Investigate leaving these disabled by default. setAttribute(Qt::WA_InputMethodEnabled); - - // viewport part of the graphics view has to be enabled - // as well, because when events come this widget is asked - // for input context and so on viewport()->setAttribute(Qt::WA_InputMethodEnabled); } @@ -1046,11 +1038,8 @@ QGraphicsView::QGraphicsView(QGraphicsScene *scene, QWidget *parent) setViewport(0); setAcceptDrops(true); setBackgroundRole(QPalette::Base); + // Investigate leaving these disabled by default. setAttribute(Qt::WA_InputMethodEnabled); - - // viewport part of the graphics view has to be enabled - // as well, because when events come this widget is asked - // for input context and so on viewport()->setAttribute(Qt::WA_InputMethodEnabled); } @@ -1063,11 +1052,8 @@ QGraphicsView::QGraphicsView(QGraphicsViewPrivate &dd, QWidget *parent) setViewport(0); setAcceptDrops(true); setBackgroundRole(QPalette::Base); + // Investigate leaving these disabled by default. setAttribute(Qt::WA_InputMethodEnabled); - - // viewport part of the graphics view has to be enabled - // as well, because when events come this widget is asked - // for input context and so on viewport()->setAttribute(Qt::WA_InputMethodEnabled); } |