X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsubwindows%2Fdecoder_selector%2Fsubwindow.hpp;h=6f6456d3bff16292855cae6dc14bd71c1fb5a9bd;hp=baeedd36dad343a7247a8bdf53be2b2643c49916;hb=b229a1b72d6f675e0fcf14aa83285e5c3ca122be;hpb=c2b80ad9a17caef1089848134b2354c544ea1dc3 diff --git a/pv/subwindows/decoder_selector/subwindow.hpp b/pv/subwindows/decoder_selector/subwindow.hpp index baeedd36..6f6456d3 100644 --- a/pv/subwindows/decoder_selector/subwindow.hpp +++ b/pv/subwindows/decoder_selector/subwindow.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -84,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 @@ -112,17 +130,20 @@ Q_SIGNALS: void new_decoders_selected(vector decoders); public Q_SLOTS: - void on_item_clicked(const QModelIndex& index); - 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_; - QTreeView* tree_view_; + QCustomTreeView* tree_view_; QWidget* info_box_; QLabel* info_label_header_; QLabel* info_label_body_; QLabel* info_label_footer_; DecoderCollectionModel* model_; + QCustomSortFilterProxyModel* sort_filter_model_; }; } // decoder_selector