| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Member Functions | List of all members
LuaDebuggerFontPolicy Class Reference

Owns the dialog's font story end-to-end. More...

`#include <lua_debugger_code_editor.h>`

## Public Member Functions
| LuaDebuggerFontPolicy ()=default
| Default constructor for the font policy.
void | attach (QTabWidget *codeTabs, QTreeView *variablesTree, QTreeView *watchTree, QStandardItemModel *watchModel, QTreeView *stackTree, QTreeView *fileTree, QTreeView *breakpointsTree, QPlainTextEdit *evalInputEdit, QPlainTextEdit *evalOutputEdit)
| Seed the policy with the dialog's panel widgets. Idempotent.
void | applyAll ()
| Apply zoomed monospace to code editors and panel mono + regular header fonts to the side panels. Single entry point for "font preference changed".
void | applyToCodeEditors (const QFont &font=QFont())
| Apply the (optionally explicit) monospace to all open code-view tabs. When `font` is empty, falls back to the current zoomed monospace.
void | applyToPanels ()
| Apply panel-mono bodies + regular headers to all side panels and re-sync watch QStandardItem fonts. Public so layout-changing widgets (e.g. the watch tree after a DnD reorder) can request a re-seat.
void | reapplyToWatchItemModel ()
| Re-walk the watch model and seed each item's font to panel-mono, preserving its current bold flag (used by change-highlight).
QFont | monospaceFont (bool zoomed) const
| Effective monospace font; respects the main-app preference and the optional zoom step. Falls back to the system fixed font before main-app init.
QFont | regularFont () const
| Effective regular UI font for tree-column headers.

## Detailed Description

Owns the dialog's font story end-to-end.

One place to ask: "what monospace + header font should the panels use, and how do we re-seat them across the open code-view tabs and watch model?". Construction is widget-pointer-free so the dialog can declare the policy as a value member; attach is called once the panel widgets exist.

The watch widget keeps a pointer to this so it can call applyToPanels after a row reorder without needing a back-pointer to the dialog.

## Member Function Documentation

## ◆ applyToCodeEditors()

void LuaDebuggerFontPolicy::applyToCodeEditors | ( | const QFont & | font = QFont() | ) |

Apply the (optionally explicit) monospace to all open code-view tabs. When `font` is empty, falls back to the current zoomed monospace.

Parameters

  font | The specific font to apply, or default to current.

## ◆ attach()

void LuaDebuggerFontPolicy::attach | ( | QTabWidget * | codeTabs,
|  | QTreeView * | variablesTree,
|  | QTreeView * | watchTree,
|  | QStandardItemModel * | watchModel,
|  | QTreeView * | stackTree,
|  | QTreeView * | fileTree,
|  | QTreeView * | breakpointsTree,
|  | QPlainTextEdit * | evalInputEdit,
|  | QPlainTextEdit * | evalOutputEdit )

Seed the policy with the dialog's panel widgets. Idempotent.

Parameters

  codeTabs | The code tabs widget.
  variablesTree | The variables tree view.
  watchTree | The watch tree view.
  watchModel | The watch standard item model.
  stackTree | The stack trace tree view.
  fileTree | The files tree view.
  breakpointsTree | The breakpoints tree view.
  evalInputEdit | The evaluation input plain text edit.
  evalOutputEdit | The evaluation output plain text edit.

## ◆ monospaceFont()

QFont LuaDebuggerFontPolicy::monospaceFont | ( | bool | zoomed | ) | const

Effective monospace font; respects the main-app preference and the optional zoom step. Falls back to the system fixed font before main-app init.

Parameters

  zoomed | True to return the zoomed variant.

Returns
  The evaluated monospace font.

## ◆ regularFont()

QFont LuaDebuggerFontPolicy::regularFont | ( |  | ) | const

Effective regular UI font for tree-column headers.

Returns
  The standard UI font.

The documentation for this class was generated from the following files:

- /builds/wireshark/wireshark/ui/qt/lua_debugger/lua_debugger_code_editor.h
- /builds/wireshark/wireshark/ui/qt/lua_debugger/lua_debugger_code_editor.cpp