Make BufferView trees expanded by default.
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Jun 2007 10:00:42 +0000 (10:00 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Jun 2007 10:00:42 +0000 (10:00 +0000)
gui/bufferview.cpp
gui/bufferview.h

index 4045f20..7e2cf21 100644 (file)
@@ -106,3 +106,7 @@ void BufferView::dragEnterEvent(QDragEnterEvent *event) {
   // not yet needed... this will be usefull to keep track of the active view when customizing them with drag and drop
   QTreeView::dragEnterEvent(event);
 }
+
+void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) {
+  setExpanded(parent, true);
+}
index 307505e..6fcadf8 100644 (file)
@@ -70,14 +70,16 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)
 class BufferView : public QTreeView {
   Q_OBJECT
   
-public:
-  BufferView(QWidget *parent = 0);
-  void init();
-  void setModel(QAbstractItemModel *model);
-  void setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QStringList nets);
-  
-  void dragEnterEvent(QDragEnterEvent *);
+  public:
+    BufferView(QWidget *parent = 0);
+    void init();
+    void setModel(QAbstractItemModel *model);
+    void setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QStringList nets);
   
+    void dragEnterEvent(QDragEnterEvent *);
+
+  protected:
+    void rowsInserted (const QModelIndex & parent, int start, int end);
 };