From b9db3e4785d965905549d2033e0707922c8b74b5 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 25 Apr 2013 15:11:47 +0200 Subject: Do not include the treeview header if its hidden Previously, accessibleTree->child(0) would return an interface for the header even if it was hidden. Also, the assertion was wrong since the index would be 0 if both row and column were 0. The assertion was actually found while using the project explorer of Qt Creator (2.7) Change-Id: I9f3cc2c13b6887569d10c4e062a64552f898231a Reviewed-by: Frederik Gladhorn --- src/plugins/accessible/widgets/itemviews.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/accessible') diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp index 4ddd39f7ea..d460ec2c98 100644 --- a/src/plugins/accessible/widgets/itemviews.cpp +++ b/src/plugins/accessible/widgets/itemviews.cpp @@ -120,6 +120,8 @@ QHeaderView *QAccessibleTable::horizontalHeader() const #ifndef QT_NO_TREEVIEW } else if (const QTreeView *tv = qobject_cast(view())) { header = tv->header(); + if (header && header->isHidden()) + header = 0; #endif } return header; @@ -766,7 +768,6 @@ int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const int column = cell->m_index.column(); int index = row * view()->model()->columnCount() + column; - Q_ASSERT(index >= treeView->model()->columnCount()); return index; } else if (iface->role() == QAccessible::ColumnHeader){ const QAccessibleTableHeaderCell* cell = static_cast(iface); -- cgit v1.2.3