31class InPacketFindBar :
public QWidget
34 Q_PROPERTY(
int barHeight READ barHeight WRITE setBarHeight)
37 explicit InPacketFindBar(
ProtoTree *tree, QWidget *parent =
nullptr);
40 static int openInstances() {
return open_instances_; }
44 void focusSearchField();
46 bool isOpen()
const {
return is_open_; }
48 bool isMatch(
const QModelIndex &model_index)
const;
49 bool isCurrentMatch(
const QModelIndex &model_index)
const;
51 int barHeight()
const;
52 void setBarHeight(
int h);
55 void matchesChanged();
56 void openChanged(
bool open);
59 bool eventFilter(QObject *obj, QEvent *event)
override;
60 void keyPressEvent(QKeyEvent *event)
override;
63 void onTextChanged(
const QString &text);
67 void onToggleChanged();
70 void advanceSearch(
bool backward);
71 void updateFindButtonState();
72 void updateStyleSheet();
73 void recalculateNaturalHeight();
74 void updateCounterLabel();
78 Ui::InPacketFindBar *ui_ =
nullptr;
80 QTimer *debounce_timer_;
81 QPropertyAnimation *animation_;
82 QString last_search_pattern_;
85 static int open_instances_;