summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMaks Naumov <maksqwe1@ukr.net>2014-09-03 10:39:07 +0300
committerMaks Naumov <maksqwe1@ukr.net>2014-09-05 13:12:21 +0200
commit9c4c0443389fd3dace13a04849c8c03481d6cbdb (patch)
treeeb22dbddea2216f80e1d43e723459180ba7c48d3 /tests
parent863f598b650417824a8d531badc7a9d074af64be (diff)
GraphicsView: Fix resolvePalette() for QGraphicsItem's children
Use a proper function for that. Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index c89b05616d..8847a5748f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -461,6 +461,7 @@ private slots:
void touchEventPropagation_data();
void touchEventPropagation();
void deviceCoordinateCache_simpleRotations();
+ void resolvePaletteForItemChildren();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -11695,5 +11696,21 @@ void tst_QGraphicsItem::QTBUG_21618_untransformable_sceneTransform()
QCOMPARE(item2_bottomright->deviceTransform(tx).map(QPointF()), QPointF(100, 300));
}
+void tst_QGraphicsItem::resolvePaletteForItemChildren()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem item(0, 0, 50, -150);
+ scene.addItem(&item);
+ QGraphicsWidget widget;
+ widget.setParentItem(&item);
+
+ QColor green(Qt::green);
+ QPalette paletteForScene = scene.palette();
+ paletteForScene.setColor(QPalette::Active, QPalette::Window, green);
+ scene.setPalette(paletteForScene);
+
+ QCOMPARE(widget.palette().color(QPalette::Active, QPalette::Window), green);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"