summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorNick Shaforostov <mshaforostov@airmusictech.com>2021-02-02 18:26:49 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-18 15:45:09 +0000
commit8ba75230ec5f4342043405fabc52acad30736ba8 (patch)
treec446fd2ece1fda19cccde1f9d10a8602d261ef0a /src/widgets
parent9c90e976b02825515b364cc942bb0c160d3afb54 (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/widgets')
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index 3b2d1a80ff..f675092bd0 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -369,10 +369,12 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
{
if (!event || !view)
return false;
- Q_D(QAbstractItemDelegate);
+ Q_UNUSED(index);
+ Q_UNUSED(option);
switch (event->type()) {
#if QT_CONFIG(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() ?
@@ -393,6 +395,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() ?
@@ -403,6 +406,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
break;
}
#endif
+ case QEvent::None:
default:
break;
}