]> sigrok.org Git - pulseview.git/blobdiff - pv/subwindows/decoder_selector/subwindow.hpp
DecoderSelector: Implement filtering
[pulseview.git] / pv / subwindows / decoder_selector / subwindow.hpp
index 1b75a6c7d3bc30fd59eed491c3ff59b1bf1f40c7..6f6456d3bff16292855cae6dc14bd71c1fb5a9bd 100644 (file)
@@ -23,6 +23,8 @@
 #include <vector>
 
 #include <QAbstractItemModel>
 #include <vector>
 
 #include <QAbstractItemModel>
+#include <QLabel>
+#include <QSortFilterProxyModel>
 #include <QSplitter>
 #include <QTreeView>
 
 #include <QSplitter>
 #include <QTreeView>
 
@@ -83,6 +85,23 @@ private:
 };
 
 
 };
 
 
+class QCustomSortFilterProxyModel : public QSortFilterProxyModel
+{
+protected:
+       bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
+};
+
+class QCustomTreeView : public QTreeView
+{
+       Q_OBJECT
+
+public:
+       void currentChanged(const QModelIndex& current, const QModelIndex& previous);
+
+Q_SIGNALS:
+       void currentChanged(const QModelIndex& current);
+};
+
 class SubWindow : public SubWindowBase
 {
        Q_OBJECT
 class SubWindow : public SubWindowBase
 {
        Q_OBJECT
@@ -111,12 +130,20 @@ Q_SIGNALS:
        void new_decoders_selected(vector<const srd_decoder*> decoders);
 
 public Q_SLOTS:
        void new_decoders_selected(vector<const srd_decoder*> decoders);
 
 public Q_SLOTS:
-       void on_item_double_clicked(const QModelIndex& index);
+       void on_item_changed(const QModelIndex& index);
+       void on_item_activated(const QModelIndex& index);
+
+       void on_filter_changed(const QString& text);
 
 private:
        QSplitter* splitter_;
 
 private:
        QSplitter* splitter_;
-       QTreeView* tree_view_;
+       QCustomTreeView* tree_view_;
+       QWidget* info_box_;
+       QLabel* info_label_header_;
+       QLabel* info_label_body_;
+       QLabel* info_label_footer_;
        DecoderCollectionModel* model_;
        DecoderCollectionModel* model_;
+       QCustomSortFilterProxyModel* sort_filter_model_;
 };
 
 } // decoder_selector
 };
 
 } // decoder_selector