#include <QAbstractItemModel>
#include <QLabel>
+#include <QSortFilterProxyModel>
#include <QSplitter>
#include <QTreeView>
};
+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
bool has_toolbar() const;
QToolBar* create_toolbar(QWidget *parent) const;
- const srd_decoder* get_srd_decoder_from_id(QString id) const;
-
/**
* Returns a list of input types that a given protocol decoder requires
* ("logic", "uart", etc.)
*/
- vector<const char*> decoder_inputs(const srd_decoder* d) const;
+ vector<const char*> get_decoder_inputs(const srd_decoder* d) const;
/**
* Returns a list of protocol decoder IDs which provide a given output
* ("uart", "spi", etc.)
*/
- vector<const srd_decoder*> decoders_providing(const char* output) const;
+ vector<const srd_decoder*> get_decoders_providing(const char* output) const;
Q_SIGNALS:
void new_decoders_selected(vector<const srd_decoder*> 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