summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2012-09-18 13:55:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-27 15:16:16 +0200
commit570ae40f57f048d53ed32d035804746a11489f48 (patch)
treec0e70a04ed0a37cca52098d91a7ee5b5c74bb9e5 /tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
parent05978af3a161ed0d830e67a1220e7d2ae47d8938 (diff)
Remove CDE and Motif styles from qtbase
It is time to clean up some of our legacy code. These styles have not been actively maintained for a long time and I think it is safe to say that they should no longer belong as part of the default distribution of Qt. We dont support any platforms based on CDE with our source packages. Note that even if we are removing these styles from the default distribution of Qt, applications that depend on them will still be able to bundle the existing (and unmodified) styles along with their own source code as we are not breaking compatibility. Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 43064dd540..96aba11d52 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -52,9 +52,6 @@
#include <math.h>
#include <QtWidgets/QLabel>
-#if !defined(QT_NO_STYLE_MOTIF)
-#include <QtWidgets/QMotifStyle>
-#endif
#if !defined(QT_NO_STYLE_WINDOWS)
#include <QtWidgets/QWindowsStyle>
#endif
@@ -2736,6 +2733,23 @@ void tst_QGraphicsView::scrollBarRanges_data()
_scrollBarRanges_data();
}
+// Simulates motif scrollbar for range tests
+class FauxMotifStyle : public QCommonStyle {
+public:
+ int styleHint(StyleHint hint, const QStyleOption *option,
+ const QWidget *widget, QStyleHintReturn *returnData) const {
+ if (hint == QStyle::SH_ScrollView_FrameOnlyAroundContents)
+ return true;
+ return QCommonStyle::styleHint(hint, option, widget, returnData);
+ }
+
+ int pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *widget) const {
+ if (m == QStyle::PM_ScrollView_ScrollBarSpacing)
+ return 4;
+ return QCommonStyle::pixelMetric(m, opt, widget);
+ }
+};
+
void tst_QGraphicsView::scrollBarRanges()
{
QFETCH(QSize, viewportSize);
@@ -2758,10 +2772,10 @@ void tst_QGraphicsView::scrollBarRanges()
view.setFrameStyle(useStyledPanel ? QFrame::StyledPanel : QFrame::NoFrame);
if (useMotif) {
-#if !defined(QT_NO_STYLE_MOTIF)
- view.setStyle(new QMotifStyle);
+#if !defined(QT_NO_STYLE_WINDOWS)
+ view.setStyle(new FauxMotifStyle);
#else
- QSKIP("No Motif style compiled.");
+ QSKIP("No Windows style compiled.");
#endif
} else {
#if defined(Q_OS_WINCE)