diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-11-28 14:04:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-05 17:20:35 +0100 |
commit | 6c322a917ad57d57f0ee76825eab3e2e008c5bd4 (patch) | |
tree | 74732f88c768ed11352d97838a0e3914a0378e28 /tests/auto/widgets/graphicsview | |
parent | 434b37323a6feb3210168f70ad59f5ecdaa5a597 (diff) |
Add proper abstractions to the grid layout engine.
The abstractions are needed so that they can work with both
QGraphicsLayouts and QtQuick.Layouts.
Since the plan is to move the engine to QtGui, this means that the
engine cannot have any references to anything in the QtWidgets module.
As a consequence of that several things had to be done:
* The style info object had to be redone with an abstraction layer
to get rid of style and widget dependency. (Abstract class is
called QAbstractLayoutStyleInfo)
* QGridLayoutEngine must be subclassed due to some specializations for
QGraphicsLayoutItem, manifested as QGraphicsGridLayoutEngine.
* QGridLayoutItem must be subclassed due to some specializations for
QGraphicsLayoutItem, manifested as QGraphicsGridLayoutEngineItem.
Did also some minor cleanups, reordered arguments so that all styleInfo
arguments are last in all function calls
This also fixes QTBUG-35099 (bug was spotted during this refactoring)
Task-number: QTBUG-35099
Change-Id: If49d40f71870dc8d99d2e145be158e3080b595fa
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'tests/auto/widgets/graphicsview')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 19e8819a7b..8f7a3a3255 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -971,7 +971,6 @@ void tst_QGraphicsLinearLayout::defaultSpacing() layout->invalidate(); styleSpacing = (qreal)style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing); QCOMPARE(styleSpacing, qreal(15)); - QSKIP("invalidating the layout does not reevaluate the default spacing (QTBUG-35099)"); QCOMPARE(styleSpacing, layout->spacing()); QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize).width(), qreal(115)); widget->setStyle(style2); @@ -991,7 +990,6 @@ void tst_QGraphicsLinearLayout::defaultSpacing() layout->invalidate(); styleSpacing = (qreal)style->pixelMetric(QStyle::PM_LayoutVerticalSpacing); QCOMPARE(styleSpacing, qreal(13)); - QSKIP("invalidating the layout does not reevaluate the default spacing (QTBUG-35099)"); QCOMPARE(styleSpacing, layout->spacing()); QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize).height(), qreal(113)); widget->setStyle(style2); |