X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsubwindows%2Fdecoder_selector%2Fsubwindow.hpp;h=6c3016e86cb831a854f7b54d990657bcf30c145c;hp=4434f0a610bcd2030e867acc598b5417eb3184c4;hb=8f7c2dce763c9d3439e99b0215a3654f6a18ef11;hpb=e10848e81f97360359ff80951fd01dc91a9a3847 diff --git a/pv/subwindows/decoder_selector/subwindow.hpp b/pv/subwindows/decoder_selector/subwindow.hpp index 4434f0a..6c3016e 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,12 @@ private: }; +class QCustomSortFilterProxyModel : public QSortFilterProxyModel +{ +protected: + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; +}; + class QCustomTreeView : public QTreeView { Q_OBJECT @@ -111,13 +118,13 @@ public: * Returns a list of input types that a given protocol decoder requires * ("logic", "uart", etc.) */ - vector decoder_inputs(const srd_decoder* d) const; + vector get_decoder_inputs(const srd_decoder* d) const; /** * Returns a list of protocol decoder IDs which provide a given output * ("uart", "spi", etc.) */ - vector decoders_providing(const char* output) const; + vector get_decoders_providing(const char* output) const; Q_SIGNALS: void new_decoders_selected(vector decoders); @@ -126,6 +133,8 @@ public Q_SLOTS: void on_item_changed(const QModelIndex& index); void on_item_activated(const QModelIndex& index); + void on_filter_changed(const QString& text); + private: QSplitter* splitter_; QCustomTreeView* tree_view_; @@ -134,6 +143,7 @@ private: QLabel* info_label_body_; QLabel* info_label_footer_; DecoderCollectionModel* model_; + QCustomSortFilterProxyModel* sort_filter_model_; }; } // decoder_selector