From e6c7cf930084372c708c586d93d621eef0bdd88d Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 26 Feb 2022 20:59:08 +0200 Subject: [PATCH] build fix for the case when QT_NO_STYLE_PROXY is defined Signed-off-by: Ivailo Monev --- src/core/global/qconfig.h.cmake | 2 +- tests/auto/qstyle/tst_qstyle.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/core/global/qconfig.h.cmake b/src/core/global/qconfig.h.cmake index 77b286c1a..0fdf104a1 100644 --- a/src/core/global/qconfig.h.cmake +++ b/src/core/global/qconfig.h.cmake @@ -141,6 +141,7 @@ // #cmakedefine QT_NO_STACKEDWIDGET // #cmakedefine QT_NO_STANDARDITEMMODEL // #cmakedefine QT_NO_STATUSBAR +// #cmakedefine QT_NO_STATUSTIP // Misc #cmakedefine QT_NO_USING_NAMESPACE @@ -184,7 +185,6 @@ #cmakedefine QT_NO_SHAREDMEMORY #cmakedefine QT_NO_SIZEGRIP #cmakedefine QT_NO_SPLASHSCREEN -#cmakedefine QT_NO_STATUSTIP #cmakedefine QT_NO_STRINGLISTMODEL #cmakedefine QT_NO_STYLE_CLEANLOOKS #cmakedefine QT_NO_STYLE_PROXY diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index 8259aa491..3b108f64b 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -144,6 +144,7 @@ void tst_QStyle::testStyleFactory() } } +#ifndef QT_NO_STYLE_PROXY class CustomProxy : public QProxyStyle { virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, @@ -154,9 +155,11 @@ class CustomProxy : public QProxyStyle return QProxyStyle::pixelMetric(metric, option, widget); } }; +#endif // QT_NO_STYLE_PROXY void tst_QStyle::testProxyStyle() { +#ifndef QT_NO_STYLE_PROXY QProxyStyle *proxyStyle = new QProxyStyle(); QVERIFY(proxyStyle->baseStyle()); QStyle *style = new QWindowsStyle; @@ -180,6 +183,9 @@ void tst_QStyle::testProxyStyle() edit.setStyle(&customStyle); QVERIFY(!customStyle.parent()); QVERIFY(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize) == 13); +#else // QT_NO_STYLE_PROXY + QSKIP("Katie compiled without style proxy support (QT_NO_STYLE_PROXY)", SkipAll); +#endif // QT_NO_STYLE_PROXY } void tst_QStyle::drawItemPixmap() @@ -466,6 +472,7 @@ void tst_QStyle::defaultFont() qApp->setFont(defaultFont); } +#ifndef QT_NO_STYLE_PROXY class DrawTextStyle : public QProxyStyle { Q_OBJECT @@ -481,9 +488,11 @@ public: } int alignment; }; +#endif // QT_NO_STYLE_PROXY void tst_QStyle::testDrawingShortcuts() { +#ifndef QT_NO_STYLE_PROXY { QWidget w; setFrameless(&w); @@ -514,7 +523,10 @@ void tst_QStyle::testDrawingShortcuts() bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); delete dts; - } + } +#else // QT_NO_STYLE_PROXY + QSKIP("Katie compiled without style proxy support (QT_NO_STYLE_PROXY)", SkipAll); +#endif // QT_NO_STYLE_PROXY } QTEST_MAIN(tst_QStyle)