summaryrefslogtreecommitdiff
path: root/src/qtgroupingproxy.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-06-05 10:05:29 +0200
committerTannin <devnull@localhost>2013-06-05 10:05:29 +0200
commit97111de1409a59eea9e7ab5050ab70f4d01ddb8e (patch)
tree6d3ed6dd899573d23bef15adb2519173cd844b76 /src/qtgroupingproxy.cpp
parent280691ebc36d34c803a5bd8e01616680b0d2fafb (diff)
parent1606c1366f5d0ba304334b0e57680fb99feb88b9 (diff)
Merge
Diffstat (limited to 'src/qtgroupingproxy.cpp')
-rw-r--r--src/qtgroupingproxy.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qtgroupingproxy.cpp b/src/qtgroupingproxy.cpp
index 4e066f65..3891cc12 100644
--- a/src/qtgroupingproxy.cpp
+++ b/src/qtgroupingproxy.cpp
@@ -57,6 +57,7 @@ QtGroupingProxy::QtGroupingProxy(QAbstractItemModel *model, QModelIndex rootNode
connect( sourceModel(), SIGNAL(layoutChanged()), SLOT(buildTree()) );
connect( sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
SLOT(modelDataChanged(QModelIndex,QModelIndex)) );
+ connect( sourceModel(), SIGNAL(modelReset()), this, SLOT(resetModel()) );
if( groupedColumn != -1 )
setGroupedColumn( groupedColumn );
@@ -487,7 +488,7 @@ QtGroupingProxy::data( const QModelIndex &index, int role ) const
default: {
QModelIndex parentIndex = this->index( row, 0, index.parent() );
if (m_groupHash.value( row ).count() > 0) {
- return this->index(0, 0, parentIndex).data(role);
+ return this->index(0, column, parentIndex).data(role);
} else {
return QVariant();
}
@@ -985,6 +986,12 @@ QtGroupingProxy::modelRowsRemoved( const QModelIndex &parent, int start, int end
}
void
+QtGroupingProxy::resetModel()
+{
+ buildTree();
+}
+
+void
QtGroupingProxy::modelDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight )
{
//TODO: need to look in the groupedColumn and see if it changed and changed grouping accordingly