diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-08-10 15:06:00 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-08-11 09:37:58 (GMT) |
commit | 7f7965212438405c64566416c0f8972f06d6dcd1 (patch) | |
tree | 23f860072802d40888aff832263ac89de9125193 /src/gui/graphicsview/qgraphicsview.cpp | |
parent | dce17b9375c1fce6cb5b94554f4aaa3fc4c42f7b (diff) | |
download | Qt-7f7965212438405c64566416c0f8972f06d6dcd1.zip Qt-7f7965212438405c64566416c0f8972f06d6dcd1.tar.gz Qt-7f7965212438405c64566416c0f8972f06d6dcd1.tar.bz2 |
Refactor S60 related changes to QGraphicsItem / QGraphicsView.
The change mostly removes duplication and does minor touchups.
Reviewed-by: axis
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); } |