From 0d6f71fadac786fb94302e8f5762e37f7e598e53 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sat, 29 Aug 2009 21:34:11 +0100 Subject: Finally sticky roster group expansion. diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 75863fc..7caa150 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -80,8 +80,8 @@ void QtTreeWidget::handleDataChanged(const QModelIndex& topLeft, const QModelInd } QtTreeWidgetItem* qtItem = static_cast(topLeft.internalPointer()); if (qtItem) { - //qDebug() << "Item changed, passing expanded state to view: " << qtItem->isExpanded(); setExpanded(topLeft, qtItem->isExpanded()); + //qDebug() << "Item changed, passing expanded state to view: " << qtItem->isExpanded() << " giving an expanded state of " << isExpanded(topLeft); } } diff --git a/Swift/QtUI/Roster/RosterDelegate.cpp b/Swift/QtUI/Roster/RosterDelegate.cpp index c14f170..659f360 100644 --- a/Swift/QtUI/Roster/RosterDelegate.cpp +++ b/Swift/QtUI/Roster/RosterDelegate.cpp @@ -99,7 +99,7 @@ void RosterDelegate::paintGroup(QPainter* painter, const QStyleOptionViewItem& o contactCountWidth = groupMetrics.width(countString) + 2 * horizontalMargin_; int offsetAmount = textRect.width() - contactCountWidth + horizontalMargin_; QRect countRect = textRect.adjusted(offsetAmount, 0, 0/*-1 * offsetAmount*/, 0); - qDebug() << "Painting count string " << countString << " at " << countRect << " from offset " << offsetAmount; + //qDebug() << "Painting count string " << countString << " at " << countRect << " from offset " << offsetAmount; paintShadowText(painter, countRect, countString); } QRect nameTextRect = textRect.adjusted(0, 0, contactCountWidth, 0); diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp index f54290a..8a319ea 100644 --- a/Swift/QtUI/Roster/RosterModel.cpp +++ b/Swift/QtUI/Roster/RosterModel.cpp @@ -24,6 +24,7 @@ void RosterModel::handleItemChanged(QtTreeWidgetItem* item) { Q_ASSERT(modelIndex.isValid()); emit itemExpanded(modelIndex, item->isExpanded()); emit dataChanged(modelIndex, modelIndex); + emit dataChanged(parent(modelIndex), parent(modelIndex)); emit layoutChanged(); } -- cgit v0.10.2-6-g49f6