diff options
Diffstat (limited to 'src/qtgroupingproxy.cpp')
| -rw-r--r-- | src/qtgroupingproxy.cpp | 9 |
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
|
