| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
lua_debugger_error_frame.h
Go to the documentation of this file.
1/* lua_debugger_error_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
14
15#ifndef LUA_DEBUGGER_ERROR_FRAME_H
16#define LUA_DEBUGGER_ERROR_FRAME_H
17
18#include <QFrame>
19
20 namespace Ui
21{
22 class LuaDebuggerErrorFrame;
23}
24
25 class QKeyEvent;
26
30 class LuaDebuggerErrorFrame : public QFrame
31{
32 Q_OBJECT
33
34 public:
39 explicit LuaDebuggerErrorFrame(QWidget *parent = nullptr);
40
44 ~LuaDebuggerErrorFrame() override;
45
50 void setErrorMessage(const QString &message);
51
56 void setEditorStyleFont(const QFont &font);
57
61 void clearErrorContent();
62
66 void schedulePrimaryFocus();
67
68 protected:
73 void keyPressEvent(QKeyEvent *event) override;
74
79 void resizeEvent(QResizeEvent *event) override;
80
85 void showEvent(QShowEvent *event) override;
86
87 private:
88 Ui::LuaDebuggerErrorFrame *ui_;
89
93 void focusPrimaryControl();
94
99 void updateCompactHeight();
100};
101
102#endif // LUA_DEBUGGER_ERROR_FRAME_H
LuaDebuggerErrorFrame::resizeEvent
void resizeEvent(QResizeEvent *event) override
Recalculates the compact height of the frame when its width changes.
Definition lua_debugger_error_frame.cpp:123
LuaDebuggerErrorFrame::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Handles key-press events; closes the frame on Escape.
Definition lua_debugger_error_frame.cpp:118
LuaDebuggerErrorFrame::showEvent
void showEvent(QShowEvent *event) override
Schedules focus transfer to the primary control when the frame becomes visible.
Definition lua_debugger_error_frame.cpp:129
LuaDebuggerErrorFrame::setEditorStyleFont
void setEditorStyleFont(const QFont &font)
Synchronises the error text box font with the Lua editor.
Definition lua_debugger_error_frame.cpp:89
LuaDebuggerErrorFrame::LuaDebuggerErrorFrame
LuaDebuggerErrorFrame(QWidget *parent=nullptr)
Constructs the error frame with an empty error state.
Definition lua_debugger_error_frame.cpp:55
LuaDebuggerErrorFrame::schedulePrimaryFocus
void schedulePrimaryFocus()
After show(), move focus to the text box.
Definition lua_debugger_error_frame.cpp:110
LuaDebuggerErrorFrame::clearErrorContent
void clearErrorContent()
Clears the displayed error message and resets the frame to its empty state.
Definition lua_debugger_error_frame.cpp:95
LuaDebuggerErrorFrame::setErrorMessage
void setErrorMessage(const QString &message)
Displays message as the current Lua error text.
Definition lua_debugger_error_frame.cpp:82
LuaDebuggerErrorFrame::~LuaDebuggerErrorFrame
~LuaDebuggerErrorFrame() override
Destroys the error frame and releases all owned resources.
Definition lua_debugger_error_frame.cpp:77