QPushButton: if mouse tracking is off, ignore state only updated when tracking
Amends 3310e13a17. 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>
bb10
parent
6949bfaa92
commit
fd8e6a203e
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue