OSDN Git Service

build fix for the case when QT_NO_STYLE_PROXY is defined
authorIvailo Monev <xakepa10@gmail.com>
Sat, 26 Feb 2022 18:59:08 +0000 (20:59 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 26 Feb 2022 18:59:08 +0000 (20:59 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/global/qconfig.h.cmake
tests/auto/qstyle/tst_qstyle.cpp

index 77b286c..0fdf104 100644 (file)
 // #cmakedefine QT_NO_STACKEDWIDGET
 // #cmakedefine QT_NO_STANDARDITEMMODEL
 // #cmakedefine QT_NO_STATUSBAR
+// #cmakedefine QT_NO_STATUSTIP
 
 // Misc
 #cmakedefine QT_NO_USING_NAMESPACE
 #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
index 8259aa4..3b108f6 100644 (file)
@@ -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)