Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
lua_debugger_find_frame.h
Go to the documentation of this file.
1/* lua_debugger_find_frame.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
15#ifndef LUA_DEBUGGER_FIND_FRAME_H
16#define LUA_DEBUGGER_FIND_FRAME_H
17
18#include <QPointer>
19
20#include "accordion_frame.h"
21
22class QEvent;
23class QKeyEvent;
24class QPlainTextEdit;
25
26namespace Ui
27{
29}
30
35{
36 Q_OBJECT
37
38public:
43 explicit LuaDebuggerFindFrame(QWidget *parent = nullptr);
44
48 ~LuaDebuggerFindFrame() override;
49
54 void setTargetEditor(QPlainTextEdit *editor);
55
60
61protected:
68 bool eventFilter(QObject *watched, QEvent *event) override;
69
74 void keyPressEvent(QKeyEvent *event) override;
75
76private:
78 Ui::LuaDebuggerFindFrame *ui_;
79
81 QPointer<QPlainTextEdit> editor_;
82
86 void focusFindField();
87
92 void findNext(bool backward);
93
98 bool selectionMatchesFind() const;
99
103 void replaceAll();
104
105private slots:
109 void on_findNextButton_clicked();
110
114 void on_findPreviousButton_clicked();
115
119 void on_replaceButton_clicked();
120
124 void on_replaceAllButton_clicked();
125
129 void on_closeButton_clicked();
130};
131
132#endif // LUA_DEBUGGER_FIND_FRAME_H
A QFrame that shows and hides itself with a slide animation.
Definition accordion_frame.h:21
Inline find/replace bar for the Lua debugger code editor (AccordionFrame).
Definition lua_debugger_find_frame.h:35
void keyPressEvent(QKeyEvent *event) override
Handles key presses within the bar (e.g. Enter to find next, Escape to close).
Definition lua_debugger_find_frame.cpp:102
void setTargetEditor(QPlainTextEdit *editor)
Sets the code editor that find/replace operations act upon.
Definition lua_debugger_find_frame.cpp:69
void scheduleFindFieldFocus()
After animatedShow(), move focus to the find field (call from dialog).
Definition lua_debugger_find_frame.cpp:89
bool eventFilter(QObject *watched, QEvent *event) override
Intercepts events on watched objects to handle editor-side keyboard shortcuts.
Definition lua_debugger_find_frame.cpp:53
~LuaDebuggerFindFrame() override
Destroys the find/replace bar.
Definition lua_debugger_find_frame.cpp:67