summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-09-15 16:41:51 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-09-15 16:41:51 (GMT)
commite727dafd5e1f28901176e42008ebc0a334d052e6 (patch)
tree0969524e67face4ea8f6f3c79214296551e2fef7 /tests/auto/qgraphicsview
parentfec8f32f86fe60a4012c67b1b5b110dc3f816c3d (diff)
downloadQt-e727dafd5e1f28901176e42008ebc0a334d052e6.zip
Qt-e727dafd5e1f28901176e42008ebc0a334d052e6.tar.gz
Qt-e727dafd5e1f28901176e42008ebc0a334d052e6.tar.bz2
Slightly better code for the test.
Then the test doesn't leak. Reviewed-by:ogoffart
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 3bed9ce..5cb9173 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -3072,11 +3072,11 @@ void tst_QGraphicsView::scrollAfterResize_data()
QTest::addColumn<QTransform>("x2");
QTest::addColumn<QTransform>("x3");
- QPlastiqueStyle *style = new QPlastiqueStyle;
+ QPlastiqueStyle style;
- int frameWidth = style->pixelMetric(QStyle::PM_DefaultFrameWidth);
- int extent = style->pixelMetric(QStyle::PM_ScrollBarExtent);
- int inside = style->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents);
+ int frameWidth = style.pixelMetric(QStyle::PM_DefaultFrameWidth);
+ int extent = style.pixelMetric(QStyle::PM_ScrollBarExtent);
+ int inside = style.styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents);
int viewportWidth = 300;
int scrollBarIndent = viewportWidth - extent - (inside ? 4 : 2)*frameWidth;
@@ -3097,8 +3097,9 @@ void tst_QGraphicsView::scrollAfterResize()
QFETCH(QTransform, x2);
QFETCH(QTransform, x3);
+ QPlastiqueStyle style;
QGraphicsView view;
- view.setStyle(new QPlastiqueStyle);
+ view.setStyle(&style);
if (reverse)
view.setLayoutDirection(Qt::RightToLeft);