diff options
author | Nick Shaforostov <mshaforostov@airmusictech.com> | 2021-02-02 18:26:49 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-07 12:20:52 +0000 |
commit | 7155139ad0b8b3f81d329a7a9d74e7e691f4ec78 (patch) | |
tree | 6dea202ab47a20cf49391e8398e53e4847d163ae /src | |
parent | 05bb808309448580e11fb805b64edaa8e7236d84 (diff) |
fix windows build when both whatsthis and tooltip are disabled
msvc produces warning there and it is treated as error
Change-Id: Ic386df615df591fa1563b147342d670bbec771d2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0ad434c2e9c81ae319840b1bc563c9f04efac524)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/itemviews/qabstractitemdelegate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 4c357d09ce..66a98107fa 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -389,10 +389,12 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event, { if (!event || !view) return false; - Q_D(QAbstractItemDelegate); + Q_UNUSED(index); + Q_UNUSED(option); switch (event->type()) { #ifndef QT_NO_TOOLTIP case QEvent::ToolTip: { + Q_D(QAbstractItemDelegate); QHelpEvent *he = static_cast<QHelpEvent*>(event); const int precision = inherits("QItemDelegate") ? 10 : 6; // keep in sync with DBL_DIG in qitemdelegate.cpp const QString tooltip = index.isValid() ? @@ -413,6 +415,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event, event->setAccepted(index.data(Qt::WhatsThisRole).isValid()); break; case QEvent::WhatsThis: { + Q_D(QAbstractItemDelegate); QHelpEvent *he = static_cast<QHelpEvent*>(event); const int precision = inherits("QItemDelegate") ? 10 : 6; // keep in sync with DBL_DIG in qitemdelegate.cpp const QString whatsthis = index.isValid() ? @@ -423,6 +426,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event, break; } #endif + case QEvent::None: default: break; } |