summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:57:12 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:57:27 +0100
commita1dbdcbd6e818118f5fc28cdd39e47a02380adbd (patch)
tree0d813d9d72baeb1b5f7be048e775896c73f134f5 /src/widgets/styles/qstylesheetstyle.cpp
parent67ea445f09db9feea4e863faa12c45fb007f53a4 (diff)
parent4cbadf699838406d14366ce61deec03cf45113f7 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 2eccb24431..1e032b237a 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -1547,11 +1547,10 @@ public:
}
}
}
- QString valueStr;
- if(value.type() == QVariant::StringList || value.type() == QVariant::List)
- valueStr = value.toStringList().join(QLatin1Char(' '));
- else
- valueStr = value.toString();
+ QString valueStr = (value.userType() == QMetaType::QStringList
+ || value.userType() == QMetaType::QVariantList)
+ ? value.toStringList().join(QLatin1Char(' '))
+ : value.toString();
cache[name] = valueStr;
return valueStr;
}
@@ -2611,16 +2610,16 @@ void QStyleSheetStyle::setProperties(QWidget *w)
QVariant v;
const QVariant value = w->property(property.toLatin1());
- switch (value.type()) {
- case QVariant::Icon: v = decl.iconValue(); break;
- case QVariant::Image: v = QImage(decl.uriValue()); break;
- case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break;
- case QVariant::Rect: v = decl.rectValue(); break;
- case QVariant::Size: v = decl.sizeValue(); break;
- case QVariant::Color: v = decl.colorValue(); break;
- case QVariant::Brush: v = decl.brushValue(); break;
+ switch (value.userType()) {
+ case QMetaType::QIcon: v = decl.iconValue(); break;
+ case QMetaType::QImage: v = QImage(decl.uriValue()); break;
+ case QMetaType::QPixmap: v = QPixmap(decl.uriValue()); break;
+ case QMetaType::QRect: v = decl.rectValue(); break;
+ case QMetaType::QSize: v = decl.sizeValue(); break;
+ case QMetaType::QColor: v = decl.colorValue(); break;
+ case QMetaType::QBrush: v = decl.brushValue(); break;
#ifndef QT_NO_SHORTCUT
- case QVariant::KeySequence: v = QKeySequence(decl.d->values.at(0).variant.toString()); break;
+ case QMetaType::QKeySequence: v = QKeySequence(decl.d->values.at(0).variant.toString()); break;
#endif
default: v = decl.d->values.at(0).variant; break;
}
@@ -4648,7 +4647,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
}
if (baseStyle()->property("_q_styleSheetRealCloseButton").toBool())
- baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant(QVariant::Invalid));
+ baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant());
}
QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap,
@@ -6128,7 +6127,7 @@ void QStyleSheetStyle::saveWidgetFont(QWidget* w, const QFont& font) const
void QStyleSheetStyle::clearWidgetFont(QWidget* w) const
{
- w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid));
+ w->setProperty("_q_styleSheetWidgetFont", QVariant());
}
// Polish palette that should be used for a particular widget, with particular states