summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-11-08 12:41:20 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-08 22:17:14 +0100
commit5dc8ab409faaf9bd5f0a75f0ac760cbd91fd7774 (patch)
tree174463a1ab6c68e341352bffca55f6522b29819f
parent5f5c8798329041db7c02d2cd0610bfe4f3b22c01 (diff)
Move QTreeView::accessibleTree2Index to the private class
It's not needed to expose that symbol. Change-Id: I65b752a41d80eb0779969fa3887c081b4c2c88db Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
-rw-r--r--src/widgets/itemviews/qtreeview.cpp25
-rw-r--r--src/widgets/itemviews/qtreeview.h1
-rw-r--r--src/widgets/itemviews/qtreeview_p.h2
3 files changed, 17 insertions, 11 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 792b75ac69..fc0d639483 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -3888,6 +3888,14 @@ void QTreeViewPrivate::_q_sortIndicatorChanged(int column, Qt::SortOrder order)
model->sort(column, order);
}
+int QTreeViewPrivate::accessibleTree2Index(const QModelIndex &index) const
+{
+ Q_Q(const QTreeView);
+
+ // Note that this will include the header, even if its hidden.
+ return (q->visualIndex(index) + (q->header() ? 1 : 0)) * index.model()->columnCount() + index.column();
+}
+
/*!
\reimp
*/
@@ -3911,8 +3919,10 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
}
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive() && current.isValid()) {
+ Q_D(QTreeView);
+
QAccessibleEvent event(this, QAccessible::Focus);
- event.setChild(accessibleTree2Index(current));
+ event.setChild(d->accessibleTree2Index(current));
QAccessible::updateAccessibility(&event);
}
#endif
@@ -3927,10 +3937,12 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
QAbstractItemView::selectionChanged(selected, deselected);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
+ Q_D(QTreeView);
+
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = accessibleTree2Index(sel);
+ int entry = d->accessibleTree2Index(sel);
Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::Selection);
event.setChild(entry);
@@ -3938,7 +3950,7 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = accessibleTree2Index(desel);
+ int entry = d->accessibleTree2Index(desel);
Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
@@ -3955,13 +3967,6 @@ int QTreeView::visualIndex(const QModelIndex &index) const
return d->viewIndex(index);
}
-int QTreeView::accessibleTree2Index(const QModelIndex &index) const
-{
- // Note that this will include the header, even if its hidden.
- return (visualIndex(index) + (header() ? 1 : 0)) * index.model()->columnCount() + index.column();
-}
-
-
QT_END_NAMESPACE
#include "moc_qtreeview.cpp"
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index a29e9b64b0..d9c6cd9269 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -224,7 +224,6 @@ private:
friend class QAccessibleTree;
friend class QAccessibleTableCell;
int visualIndex(const QModelIndex &index) const;
- int accessibleTree2Index(const QModelIndex &index) const;
Q_DECLARE_PRIVATE(QTreeView)
Q_DISABLE_COPY(QTreeView)
diff --git a/src/widgets/itemviews/qtreeview_p.h b/src/widgets/itemviews/qtreeview_p.h
index 89de435606..5d6333e856 100644
--- a/src/widgets/itemviews/qtreeview_p.h
+++ b/src/widgets/itemviews/qtreeview_p.h
@@ -239,6 +239,8 @@ public:
return (viewIndex(index) + (header ? 1 : 0)) * model->columnCount()+index.column();
}
+ int accessibleTree2Index(const QModelIndex &index) const;
+
// used for spanning rows
QVector<QPersistentModelIndex> spanningIndexes;