summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle_p.h
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2018-01-31 16:53:35 +0000
committerSérgio Martins <sergio.martins@kdab.com>2018-02-28 19:42:22 +0000
commit2b540ac7418b8076dafb0ad11a498ecf0e3f49d0 (patch)
treedde5158b8697f03cdabec98af3d607ab25988b04 /src/widgets/styles/qstylesheetstyle_p.h
parent699a263b29edc26473948d6638232b675409338b (diff)
stylesheets cleanup to prepare for a bigger patch
No behavior was changed, just cleanup so the upcoming feature can land safely, with an elegant diff. - Removed all naked qobject_casts<QStyleSheetStyle*>(), replaced them with qt_styleSheet() (which does the same, for now). - Removed a bunch of #ifdefed'out "metal hack" code. The code is disabled and enough time has passed without nobody needing it. - Removed a few "extra ? extra->style" by assigning it to a variable first. - Misc Change-Id: Ia45c38b06e2b5d2426635f730b4cb42c7ac1251d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle_p.h')
-rw-r--r--src/widgets/styles/qstylesheetstyle_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle_p.h b/src/widgets/styles/qstylesheetstyle_p.h
index 042abf5c22..d1647fb107 100644
--- a/src/widgets/styles/qstylesheetstyle_p.h
+++ b/src/widgets/styles/qstylesheetstyle_p.h
@@ -215,6 +215,13 @@ template <typename T>
class QTypeInfo<QStyleSheetStyleCaches::Tampered<T>>
: QTypeInfoMerger<QStyleSheetStyleCaches::Tampered<T>, T> {};
+
+// Returns a QStyleSheet from the given style.
+inline QStyleSheetStyle* qt_styleSheet(QStyle *style)
+{
+ return qobject_cast<QStyleSheetStyle *>(style);
+}
+
QT_END_NAMESPACE
#endif // QT_NO_STYLE_STYLESHEET
#endif // QSTYLESHEETSTYLE_P_H