summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsanchorlayout1
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>2009-11-04 17:45:32 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-11-04 23:27:14 (GMT)
commit5c1c3e0366ce6992a514148815ef25b3f1f6f66b (patch)
tree5846c8c0eb909ba530e7f0e535be141e83f6fed0 /tests/auto/qgraphicsanchorlayout1
parentd00f3afdd547b3206016b6d97f669b04f48a27d7 (diff)
downloadQt-5c1c3e0366ce6992a514148815ef25b3f1f6f66b.zip
Qt-5c1c3e0366ce6992a514148815ef25b3f1f6f66b.tar.gz
Qt-5c1c3e0366ce6992a514148815ef25b3f1f6f66b.tar.bz2
QGAL: add names to the items in some tests
Those are useful when dumping the graph in dot format for debugging. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'tests/auto/qgraphicsanchorlayout1')
-rw-r--r--tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index 1c7a159..2d6b44b 100644
--- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -162,10 +162,14 @@ Q_DECLARE_METATYPE(AnchorItemSizeHintList)
class TestWidget : public QGraphicsWidget
{
public:
- inline TestWidget(QGraphicsItem *parent = 0)
+ inline TestWidget(QGraphicsItem *parent = 0, const QString &name = QString())
: QGraphicsWidget(parent)
{
setContentsMargins( 0,0,0,0 );
+ if (name.isEmpty())
+ setData(0, QString::fromAscii("w%1").arg(int(this)));
+ else
+ setData(0, name);
}
~TestWidget()
{
@@ -1684,7 +1688,7 @@ void tst_QGraphicsAnchorLayout1::testBasicLayout()
// Create dummy widgets
QList<QGraphicsWidget *> widgets;
for (int i = 0; i < widgetCount; ++i) {
- TestWidget *w = new TestWidget;
+ TestWidget *w = new TestWidget(0, QString::fromAscii("W%1").arg(i));
widgets << w;
}