| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
LabelStack Class Reference

A QLabel that manages a stack of context-tagged text messages. More...

`#include <label_stack.h>`

Inheritance diagram for LabelStack:

## Public Slots
void | popText (int ctx)
| Remove the stack entry associated with `ctx`.

## Signals
void | toggleTemporaryFlash (bool enable)
| Emitted when the temporary flash state changes.
void | mousePressedAt (const QPoint &global_pos, Qt::MouseButton button)
| Emitted when a mouse button is pressed on the label.

## Public Member Functions
| LabelStack (QWidget *parent=0)
| Construct a LabelStack.
void | setTemporaryContext (const int ctx)
| Designate a context ID as the "temporary" context.
void | pushText (const QString &text, int ctx, const QString &tooltip=QString())
| Push a text message onto the label stack.
void | setShrinkable (bool shrinkable=true)
| Control whether the label may shrink below its preferred width.

## Protected Member Functions
void | mousePressEvent (QMouseEvent *event) override
| Forward mouse press position and button via mousePressedAt().
void | mouseReleaseEvent (QMouseEvent *event) override
| Handle mouse button release (reserved for subclass use).
void | mouseDoubleClickEvent (QMouseEvent *event) override
| Handle double-click events (reserved for subclass use).
void | mouseMoveEvent (QMouseEvent *event) override
| Handle mouse move events (reserved for subclass use).
void | contextMenuEvent (QContextMenuEvent *event) override
| Show a context menu for the label (reserved for subclass use).
void | paintEvent (QPaintEvent *event) override
| Paint the label, applying elision if shrinkable and space is tight.

## Detailed Description

A QLabel that manages a stack of context-tagged text messages.

## Constructor & Destructor Documentation

## ◆ LabelStack()

LabelStack::LabelStack | ( | QWidget * | parent = 0 | ) |
| explicit

Construct a LabelStack.

Parameters

  parent | The parent widget.

## Member Function Documentation

## ◆ contextMenuEvent()

void LabelStack::contextMenuEvent | ( | QContextMenuEvent * | event | ) |
| override protected

Show a context menu for the label (reserved for subclass use).

Parameters

  event | The context menu event.

## ◆ mouseDoubleClickEvent()

void LabelStack::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) |
| override protected

Handle double-click events (reserved for subclass use).

Parameters

  event | The double-click event.

## ◆ mouseMoveEvent()

void LabelStack::mouseMoveEvent | ( | QMouseEvent * | event | ) |
| override protected

Handle mouse move events (reserved for subclass use).

Parameters

  event | The mouse move event.

## ◆ mousePressedAt

void LabelStack::mousePressedAt | ( | const QPoint & | global_pos,
|  | Qt::MouseButton | button )
| signal

Emitted when a mouse button is pressed on the label.

Parameters

  global_pos | The cursor position in global screen coordinates.
  button | The mouse button that was pressed.

## ◆ mousePressEvent()

void LabelStack::mousePressEvent | ( | QMouseEvent * | event | ) |
| override protected

Forward mouse press position and button via mousePressedAt().

Parameters

  event | The mouse press event.

## ◆ mouseReleaseEvent()

void LabelStack::mouseReleaseEvent | ( | QMouseEvent * | event | ) |
| override protected

Handle mouse button release (reserved for subclass use).

Parameters

  event | The mouse release event.

## ◆ paintEvent()

void LabelStack::paintEvent | ( | QPaintEvent * | event | ) |
| override protected

Paint the label, applying elision if shrinkable and space is tight.

Parameters

  event | The paint event.

## ◆ popText

void LabelStack::popText | ( | int | ctx | ) |
| slot

Remove the stack entry associated with `ctx`.

Parameters

  ctx | The context ID whose entry should be removed.

## ◆ pushText()

void LabelStack::pushText | ( | const QString & | text,
|  | int | ctx,
|  | const QString & | tooltip = QString() )

Push a text message onto the label stack.

Parameters

  text | The message text to display.
  ctx | The context ID that owns this message; used to pop it later.
  tooltip | Optional tooltip string shown on hover; defaults to empty.

## ◆ setShrinkable()

void LabelStack::setShrinkable | ( | bool | shrinkable = true | ) |

Control whether the label may shrink below its preferred width.

Parameters

  shrinkable | true to allow shrinking (default); false to enforce the full preferred width.

## ◆ setTemporaryContext()

void LabelStack::setTemporaryContext | ( | const int | ctx | ) |

Designate a context ID as the "temporary" context.

Parameters

  ctx | The context ID to treat as temporary.

## ◆ toggleTemporaryFlash

void LabelStack::toggleTemporaryFlash | ( | bool | enable | ) |
| signal

Emitted when the temporary flash state changes.

Parameters

  enable | true when a temporary message is active and flashing; false when it has expired and the label has reverted.

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

- /builds/wireshark/wireshark/ui/qt/widgets/label_stack.h
- /builds/wireshark/wireshark/ui/qt/widgets/label_stack.cpp