diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-09-26 17:36:04 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-04 07:00:21 +0000 |
commit | 21355b3630882932be940a48a88d8c40cf7ebf63 (patch) | |
tree | 7228a7b44299f02a500f7502db509e84d262e290 /src/widgets/graphicsview/qgraphicsscene.h | |
parent | d37d8e962a1b9e83800d17207c78bc87f7d64c31 (diff) |
QGraphicsScene: Make focusing on touchBegin optional
Usually we focus in when we receive a click or equivalent.
QGraphicsScene by default also transfers the focus when you start a
touch on a trackpad or similar. Most of the time this also generates a
synthetic mouse click, so people don't necessary notice. However, at
least on macOS you can configure this behavior. With focusOnTouch
switched off, QGraphicsScene behaves as one would expect on macOS.
Fixes: QTBUG-59442
Change-Id: Ib87112640eef6b77892ad2490d80eedd055e6dce
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsscene.h')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h index 8efbcd273e..287e551db7 100644 --- a/src/widgets/graphicsview/qgraphicsscene.h +++ b/src/widgets/graphicsview/qgraphicsscene.h @@ -106,6 +106,7 @@ class Q_WIDGETS_EXPORT QGraphicsScene : public QObject Q_PROPERTY(bool sortCacheEnabled READ isSortCacheEnabled WRITE setSortCacheEnabled) Q_PROPERTY(bool stickyFocus READ stickyFocus WRITE setStickyFocus) Q_PROPERTY(qreal minimumRenderSize READ minimumRenderSize WRITE setMinimumRenderSize) + Q_PROPERTY(bool focusOnTouch READ focusOnTouch WRITE setFocusOnTouch) public: enum ItemIndexMethod { @@ -253,6 +254,9 @@ public: qreal minimumRenderSize() const; void setMinimumRenderSize(qreal minSize); + bool focusOnTouch() const; + void setFocusOnTouch(bool enabled); + public Q_SLOTS: void update(const QRectF &rect = QRectF()); void invalidate(const QRectF &rect = QRectF(), SceneLayers layers = AllLayers); |