20 #ifndef PULSEVIEW_PV_SUBWINDOWS_DECODERSELECTOR_SUBWINDOW_HPP 21 #define PULSEVIEW_PV_SUBWINDOWS_DECODERSELECTOR_SUBWINDOW_HPP 25 #include <QAbstractItemModel> 27 #include <QSortFilterProxyModel> 33 using std::shared_ptr;
36 namespace subwindows {
37 namespace decoder_selector {
43 shared_ptr<DecoderCollectionItem>
parent =
nullptr);
47 shared_ptr<DecoderCollectionItem>
subItem(
int row)
const;
48 shared_ptr<DecoderCollectionItem>
parent()
const;
49 shared_ptr<DecoderCollectionItem>
findSubItem(
const QVariant&
value,
int column);
54 QVariant
data(
int column)
const;
57 vector< shared_ptr<DecoderCollectionItem> >
subItems_;
59 shared_ptr<DecoderCollectionItem>
parent_;
70 QVariant
data(
const QModelIndex& index,
int role)
const override;
71 Qt::ItemFlags flags(
const QModelIndex& index)
const override;
73 QVariant headerData(
int section, Qt::Orientation orientation,
74 int role = Qt::DisplayRole)
const override;
75 QModelIndex index(
int row,
int column,
76 const QModelIndex& parent_idx = QModelIndex())
const override;
78 QModelIndex
parent(
const QModelIndex& index)
const override;
80 int rowCount(
const QModelIndex& parent_idx = QModelIndex())
const override;
81 int columnCount(
const QModelIndex& parent_idx = QModelIndex())
const override;
84 shared_ptr<DecoderCollectionItem>
root_;
91 bool filterAcceptsRow(
int source_row,
const QModelIndex& source_parent)
const;
99 void currentChanged(
const QModelIndex& current,
const QModelIndex& previous);
102 void current_changed(
const QModelIndex& current);
112 bool has_toolbar()
const;
115 int minimum_width()
const;
121 vector<const char*> get_decoder_inputs(
const srd_decoder* d)
const;
127 vector<const srd_decoder*> get_decoders_providing(
const char* output)
const;
130 void new_decoders_selected(vector<const srd_decoder*> decoders);
133 void on_item_changed(
const QModelIndex& index);
134 void on_item_activated(
const QModelIndex& index);
136 void on_filter_changed(
const QString& text);
137 void on_filter_return_pressed();
154 #endif // PULSEVIEW_PV_SUBWINDOWS_DECODERSELECTOR_SUBWINDOW_HPP shared_ptr< DecoderCollectionItem > findSubItem(const QVariant &value, int column)
QVariant data(int column) const
vector< shared_ptr< DecoderCollectionItem > > subItems_
QLabel * info_label_body_
QLabel * info_label_footer_
T value(details::expression_node< T > *n)
shared_ptr< DecoderCollectionItem > parent() const
QCustomTreeView * tree_view_
DecoderCollectionItem(const vector< QVariant > &data, shared_ptr< DecoderCollectionItem > parent=nullptr)
DecoderCollectionModel * model_
QCustomSortFilterProxyModel * sort_filter_model_
shared_ptr< DecoderCollectionItem > parent_
QLabel * info_label_header_
shared_ptr< DecoderCollectionItem > root_
shared_ptr< DecoderCollectionItem > subItem(int row) const
void appendSubItem(shared_ptr< DecoderCollectionItem > item)