summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-04-07 13:53:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-07 23:41:30 +0200
commitd9077669a114775273779d42f466175fbd4ad725 (patch)
tree178e2b3dc4b21785117486dd0c1bb00486f64f73
parent9c2ecf89eb773b4929d39a0a4929ce2b647aaaef (diff)
tst_QTreeView: fix use of uninited variable
Valgrind complained: ==13941== Conditional jump or move depends on uninitialised value(s) ==13941== at 0x4206FC: tst_QTreeView::styleOptionViewItem()::MyDelegate::paint(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const (tst_qtreeview.cpp:3062) [...] Change-Id: I76da01c191415ba0a00b4b85312f2fe08e4ee2d2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index b07009aa3c..0579914940 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -3047,7 +3047,13 @@ void tst_QTreeView::styleOptionViewItem()
static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" };
return s_pos[pos];
}
- public:
+ public:
+ MyDelegate()
+ : QStyledItemDelegate(),
+ count(0),
+ allCollapsed(false)
+ {}
+
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
QVERIFY(qstyleoption_cast<const QStyleOptionViewItemV4 *>(&option));