summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-10-27 11:45:21 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-27 11:52:44 (GMT)
commit0897713a560700f574386499a872f59e3fc4ce7d (patch)
tree28a48428cd0e74add989e9068f70ea1b8551a439 /tests/auto/qtreeview
parent5ff7b773a0f59e174001da1f0550a7f0c2b6f485 (diff)
downloadQt-0897713a560700f574386499a872f59e3fc4ce7d.zip
Qt-0897713a560700f574386499a872f59e3fc4ce7d.tar.gz
Qt-0897713a560700f574386499a872f59e3fc4ce7d.tar.bz2
QTreeView: Make sure the state QStyle::State_Sibling is correctly set
That state used not to be set for drawing the content of the items. Also, it could be wrong for branches if there was hidden items. Reviewed-by: Thierry Task-number: related to 234930
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 8d824cb..cbc999f 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -2913,6 +2913,7 @@ void tst_QTreeView::styleOptionViewItem()
QCOMPARE(opt.checkState, Qt::Unchecked);
QCOMPARE(!(opt.state & QStyle::State_Children) , !opt.text.contains("HasChildren"));
+ QCOMPARE(!!(opt.state & QStyle::State_Sibling) , !opt.text.contains("Last"));
QVERIFY(!opt.text.contains("Assert"));
@@ -2942,6 +2943,8 @@ void tst_QTreeView::styleOptionViewItem()
checked->setCheckState(Qt::Checked);
model.appendRow(QList<QStandardItem*>()
<< new QStandardItem("Beginning") << checkable << checked << new QStandardItem("End") );
+ model.appendRow(QList<QStandardItem*>()
+ << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
par1->appendRow(QList<QStandardItem*>()
<< new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
@@ -2949,14 +2952,18 @@ void tst_QTreeView::styleOptionViewItem()
par1->appendRow(QList<QStandardItem*>()
<< par2 << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
par2->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
- QStandardItem *par3 = new QStandardItem("Beginning");
+ QStandardItem *par3 = new QStandardItem("Beginning Last");
par1->appendRow(QList<QStandardItem*>()
- << par3 << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ << par3 << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
par3->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
view.setRowHidden(0, par3->index(), true);
+ par1->appendRow(QList<QStandardItem*>()
+ << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
+ view.setRowHidden(3, par1->index(), true);
+
view.setFirstColumnSpanned(2, QModelIndex(), true);
view.setAlternatingRowColors(true);