summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-11-01 23:04:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-11-01 23:04:03 (GMT)
commit16d50c0df983e96a28a6572da27b3633b40a41d7 (patch)
tree9b7a74f074e33d00966b2e8bf71d31162fa619dc /Swift/QtUI/Roster/QtTreeWidget.h
parenta710cb325c7827679c35c61ab41b821a5bc77673 (diff)
downloadswift-contrib-16d50c0df983e96a28a6572da27b3633b40a41d7.zip
swift-contrib-16d50c0df983e96a28a6572da27b3633b40a41d7.tar.bz2
Having a play with a compact roster mode
Diffstat (limited to 'Swift/QtUI/Roster/QtTreeWidget.h')
-rw-r--r--Swift/QtUI/Roster/QtTreeWidget.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.h b/Swift/QtUI/Roster/QtTreeWidget.h
index 271fbd5..705c039 100644
--- a/Swift/QtUI/Roster/QtTreeWidget.h
+++ b/Swift/QtUI/Roster/QtTreeWidget.h
@@ -10,36 +10,38 @@
#include <QModelIndex>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QDragMoveEvent>
#include "Swift/QtUI/Roster/RosterModel.h"
#include "Swift/QtUI/Roster/RosterDelegate.h"
namespace Swift {
class UIEventStream;
+class QtUIPreferences;
class QtTreeWidget : public QTreeView{
Q_OBJECT
public:
- QtTreeWidget(UIEventStream* eventStream, QWidget* parent = 0);
+ QtTreeWidget(UIEventStream* eventStream, QtUIPreferences* uiPreferences, QWidget* parent = 0);
~QtTreeWidget();
void show();
QtTreeWidgetItem* getRoot();
void setRosterModel(Roster* roster);
Roster* getRoster() {return roster_;}
boost::signal<void (RosterItem*)> onSomethingSelectedChanged;
private slots:
void handleItemActivated(const QModelIndex&);
void handleModelItemExpanded(const QModelIndex&, bool expanded);
void handleExpanded(const QModelIndex&);
void handleCollapsed(const QModelIndex&);
void handleClicked(const QModelIndex&);
+ void handleCompactRostersToggled(bool compact);
protected:
void dragEnterEvent(QDragEnterEvent* event);
void dropEvent(QDropEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
protected:
QModelIndexList getSelectedIndexes() const;
private:
void drawBranches(QPainter*, const QRect&, const QModelIndex&) const;
@@ -47,12 +49,13 @@ class QtTreeWidget : public QTreeView{
virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous);
protected:
UIEventStream* eventStream_;
private:
RosterModel* model_;
Roster* roster_;
RosterDelegate* delegate_;
QtTreeWidgetItem* treeRoot_;
+ QtUIPreferences* uiPreferences_;
};
}