|
Wireshark 4.7.2
The Wireshark network protocol analyzer
|
QHeaderView subclass that adapts its size based on the font. More...
#include <adaptive_header_view.h>
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 |
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.
| AdaptiveHeaderView::AdaptiveHeaderView | ( | Qt::Orientation | orientation, |
| QWidget * | parent = nullptr ) |
Constructs an AdaptiveHeaderView.
| orientation | The orientation of the header. |
| parent | The parent widget. |
|
overridevirtual |
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.