diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-26 17:15:56 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-27 22:29:05 +0100 |
commit | fd8e6a203ecfeebc03772b3bce14c91a6fc0a8e1 (patch) | |
tree | a0dbddbc6e9ce979405029b41389f706896bd3e3 /src/widgets/widgets/qpushbutton.cpp | |
parent | 6949bfaa92209d6e58d0939e095aa7a05aa17434 (diff) |
QPushButton: if mouse tracking is off, ignore state only updated when tracking
Amends 3310e13a17d2249a86fa533e350744c5593be54f. The explicit hovering state
is only updated when handling MouseMove events, and those are only
delivered when mouseTracking is set. Without mouseTracking set, the state
was always false, and QPushButton didn't set the MouseOver style flag.
Ignore the new state if mouse tracking is not set.
Task-number: QTBUG-87706
Change-Id: I2718fb23c206fd8dfd427edc987ff193ba1be8a0
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qpushbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qpushbutton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 3645b5e03d..65c0966092 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -330,7 +330,7 @@ void QPushButton::initStyleOption(QStyleOptionButton *option) const option->state |= QStyle::State_On; if (!d->flat && !d->down) option->state |= QStyle::State_Raised; - if (underMouse()) + if (underMouse() && hasMouseTracking()) option->state.setFlag(QStyle::State_MouseOver, d->hovering); option->text = d->text; option->icon = d->icon; |