summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <j-p.nurmi@nokia.com>2012-08-28 15:33:35 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-31 18:56:35 +0200
commit60783291ff967b1441518e749d2dcf4e7bc4b831 (patch)
tree1b187fadac7ce4e214039b9e9ecfd887a8dade16 /tests
parent50e3da79bf15374cc6e2b7a108004a1b7b1c4126 (diff)
auto tests: updated for new QStyle pure virtuals
QStyle::standardIconImplementation() & layoutSpacingImplementation() are removed, and standardIcon() & layoutSpacing() made pure virtual. Change-Id: If8ab6cfef0b639b7973be22dd630ba3e6f39a225 Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp15
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp23
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp16
3 files changed, 34 insertions, 20 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 555908c68c..ff59d6dda1 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -1135,19 +1135,18 @@ public:
int hspacing;
int vspacing;
-protected slots:
- int layoutSpacingImplementation(QSizePolicy::ControlType control1,
- QSizePolicy::ControlType control2,
- Qt::Orientation orientation,
- const QStyleOption *option = 0,
- const QWidget *widget = 0) const;
+ int layoutSpacing(QSizePolicy::ControlType control1,
+ QSizePolicy::ControlType control2,
+ Qt::Orientation orientation,
+ const QStyleOption *option = 0,
+ const QWidget *widget = 0) const;
};
#define CT1(c) CT2(c, c)
#define CT2(c1, c2) ((uint)c1 << 16) | (uint)c2
-int CustomLayoutStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1,
+int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
const QStyleOption * /*option = 0*/,
@@ -1233,7 +1232,7 @@ void tst_QGraphicsAnchorLayout::styleDefaults()
QGraphicsWidget *window = new QGraphicsWidget(0, Qt::Window);
- // Test layoutSpacingImplementation
+ // Test layoutSpacing
CustomLayoutStyle *style = new CustomLayoutStyle;
style->hspacing = -1;
style->vspacing = -1;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index b0db1fe88d..48c786aa9d 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -85,8 +85,8 @@ private slots:
void styleDependentSpacingsAndMargins_data();
void styleDependentSpacingsAndMargins();
- void layoutSpacingImplementation_data();
- void layoutSpacingImplementation();
+ void layoutSpacing_data();
+ void layoutSpacing();
void spacing();
void spacerWithSpacing();
void contentsRect();
@@ -944,12 +944,11 @@ public:
int vspacing;
bool reimplementSubelementRect;
-protected slots:
- int layoutSpacingImplementation(QSizePolicy::ControlType control1,
- QSizePolicy::ControlType control2,
- Qt::Orientation orientation,
- const QStyleOption *option = 0,
- const QWidget *widget = 0) const;
+ int layoutSpacing(QSizePolicy::ControlType control1,
+ QSizePolicy::ControlType control2,
+ Qt::Orientation orientation,
+ const QStyleOption *option = 0,
+ const QWidget *widget = 0) const;
};
@@ -978,7 +977,7 @@ QRect CustomLayoutStyle::subElementRect(SubElement sr, const QStyleOption *opt,
#define CT1(c) CT2(c, c)
#define CT2(c1, c2) ((uint)c1 << 16) | (uint)c2
-int CustomLayoutStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1,
+int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
const QStyleOption * /*option = 0*/,
@@ -1091,7 +1090,7 @@ void tst_QGridLayout::styleDependentSpacingsAndMargins()
}
}
-void tst_QGridLayout::layoutSpacingImplementation_data()
+void tst_QGridLayout::layoutSpacing_data()
{
QTest::addColumn<QWidget*>("widget");
// expected
@@ -1103,7 +1102,7 @@ void tst_QGridLayout::layoutSpacingImplementation_data()
CustomLayoutStyle *style = new CustomLayoutStyle();
{
// If the layoutSpacing is negative, the layouting code will call
- // layoutSpacingImplementation()
+ // layoutSpacing()
style->hspacing = -1;
style->vspacing = -1;
style->reimplementSubelementRect = false;
@@ -1441,7 +1440,7 @@ void tst_QGridLayout::layoutSpacingImplementation_data()
}
-void tst_QGridLayout::layoutSpacingImplementation()
+void tst_QGridLayout::layoutSpacing()
{
QFETCH(QWidget *, widget);
QFETCH(PointList, expectedpositions);
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 12cdbf5d3d..0fb3060dc8 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -1168,6 +1168,22 @@ class ProxyStyle : public QStyle
return style->generatedIconPixmap(mode, pix, opt);
}
+ int layoutSpacing(QSizePolicy::ControlType c1,
+ QSizePolicy::ControlType c2,
+ Qt::Orientation ori,
+ const QStyleOption *opt,
+ const QWidget *w) const
+ {
+ return style->layoutSpacing(c1, c2, ori, opt, w);
+ }
+
+ QIcon standardIcon(StandardPixmap si,
+ const QStyleOption *opt,
+ const QWidget *w) const
+ {
+ return style->standardIcon(si, opt, w);
+ }
+
private:
QStyle *style;
};