diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-07-05 15:13:44 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-07-06 10:34:34 +0000 |
commit | 4927fdb389b9fbc0d5118437274d4fa3c59fc839 (patch) | |
tree | 776916bc00a49009d4450e97f8203f9f195b4c3c /src/widgets/widgets/qabstractspinbox.cpp | |
parent | 3cc2884c031e0ab1098f59fae9aa6e05f54d36f8 (diff) |
Fix misleading code in QAbstractSpinBox::event()
A static_cast never returns nullptr unless its argument
already was nullptr. But we dereferenced 'event' already
by the time we reach this code, so the if is always true.
Fix by removing the temporary variable.
Change-Id: Ia869d37eda74f0bcdd616e1f57f429cc86e9e525
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/widgets/qabstractspinbox.cpp')
-rw-r--r-- | src/widgets/widgets/qabstractspinbox.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index ba4bbe40a8..854befd265 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -751,8 +751,7 @@ bool QAbstractSpinBox::event(QEvent *event) case QEvent::HoverEnter: case QEvent::HoverLeave: case QEvent::HoverMove: - if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event)) - d->updateHoverControl(he->pos()); + d->updateHoverControl(static_cast<const QHoverEvent *>(event)->pos()); break; case QEvent::ShortcutOverride: if (d->edit->event(event)) |