| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

QHeaderView subclass that adapts its size based on the font. More...

`#include <adaptive_header_view.h>`

Inheritance diagram for AdaptiveHeaderView:

## Public Member Functions
| AdaptiveHeaderView (Qt::Orientation orientation, QWidget *parent=nullptr)
| Constructs an AdaptiveHeaderView.
virtual QSize | sizeHint () const override
| Overriding sizeHint to provide proper heights when font changes.

## Protected Member Functions
virtual void | changeEvent (QEvent *event) override

## Detailed Description

QHeaderView subclass that adapts its size based on the font.

This class ensures that the header height is updated when the font changes, providing a consistent appearance even when the font is zoomable.

The font is still set through the parent (PacketList in the case of the packet list header), so that it is shared with the rest of the UI. This class simply ensures that the header height is updated when the font changes, by overriding sizeHint and responding to font change events.

We could instead register directly with FontManager and update the size hint when the font changes, but that would require a bigger redesign.

## Constructor & Destructor Documentation

## ◆ AdaptiveHeaderView()

AdaptiveHeaderView::AdaptiveHeaderView | ( | Qt::Orientation | orientation,
|  | QWidget * | parent = nullptr )

Constructs an AdaptiveHeaderView.

Parameters

  orientation | The orientation of the header.
  parent | The parent widget.

## Member Function Documentation

## ◆ sizeHint()

QSize AdaptiveHeaderView::sizeHint | ( |  | ) | const
| override virtual

Overriding sizeHint to provide proper heights when font changes.

Starting with 5.x the regular font is zoomable and therefore the header can change its height. This override ensures that the header height is updated when the font changes.

Returns
  QSize the size of the header view

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

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