summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r--Swift/QtUI/Roster/QtTreeWidget.cpp1
-rw-r--r--Swift/QtUI/Roster/QtTreeWidget.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp
index 6ace3df..885cba6 100644
--- a/Swift/QtUI/Roster/QtTreeWidget.cpp
+++ b/Swift/QtUI/Roster/QtTreeWidget.cpp
@@ -46,6 +46,7 @@ QtTreeWidget::~QtTreeWidget() {
}
void QtTreeWidget::setRosterModel(Roster* roster) {
+ roster_ = roster;
model_->setRoster(roster);
expandAll();
}
diff --git a/Swift/QtUI/Roster/QtTreeWidget.h b/Swift/QtUI/Roster/QtTreeWidget.h
index 796afed..838c453 100644
--- a/Swift/QtUI/Roster/QtTreeWidget.h
+++ b/Swift/QtUI/Roster/QtTreeWidget.h
@@ -26,6 +26,7 @@ class QtTreeWidget : public QTreeView{
QtTreeWidgetItem* getRoot();
void setContextMenu(QtContextMenu* contextMenu);
void setRosterModel(Roster* roster);
+ Roster* getRoster() {return roster_;}
private slots:
void handleItemActivated(const QModelIndex&);
void handleModelItemExpanded(const QModelIndex&, bool expanded);
@@ -38,6 +39,7 @@ class QtTreeWidget : public QTreeView{
private:
void drawBranches(QPainter*, const QRect&, const QModelIndex&) const;
RosterModel* model_;
+ Roster* roster_;
RosterDelegate* delegate_;
QtTreeWidgetItem* treeRoot_;
QtContextMenu* contextMenu_;