Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QCPAxisTickerElided Class Reference

QCPAxisTickerText specialisation that elides tick labels to fit within the available axis space, preventing text overflow on crowded or narrow axes. More...

#include <qcp_axis_ticker_elided.h>

Inheritance diagram for QCPAxisTickerElided:

Public Member Functions

 QCPAxisTickerElided (QCPAxis *parent)
 Constructs a QCPAxisTickerElided bound to the given axis.
 
QString elidedText (const QString &text)
 Returns text elided to fit within the available tick-label width of the parent axis, appending an ellipsis if truncation is needed.
 

Static Public Member Functions

static QCP::MarginSide axisTypeToMarginSide (const QCPAxis::AxisType axisType)
 Converts a QCPAxis AxisType to its corresponding QCP::MarginSide.
 

Protected Member Functions

virtual QString getTickLabel (double tick, const QLocale &locale, QChar formatChar, int precision) override
 Returns the (possibly elided) label string for the tick at tick.
 

Detailed Description

QCPAxisTickerText specialisation that elides tick labels to fit within the available axis space, preventing text overflow on crowded or narrow axes.

Constructor & Destructor Documentation

◆ QCPAxisTickerElided()

QCPAxisTickerElided::QCPAxisTickerElided ( QCPAxis *  parent)
explicit

Constructs a QCPAxisTickerElided bound to the given axis.

Parameters
parentThe QCPAxis whose tick labels this ticker will generate and elide.

Member Function Documentation

◆ axisTypeToMarginSide()

QCP::MarginSide QCPAxisTickerElided::axisTypeToMarginSide ( const QCPAxis::AxisType  axisType)
static

Converts a QCPAxis AxisType to its corresponding QCP::MarginSide.

QCustomPlot provides QCP::marginSideToAxisType() but not the inverse; this utility fills that gap.

Parameters
axisTypeThe axis type to convert (Left, Right, Top, or Bottom).
Returns
The QCP::MarginSide that corresponds to axisType.

◆ elidedText()

QString QCPAxisTickerElided::elidedText ( const QString &  text)

Returns text elided to fit within the available tick-label width of the parent axis, appending an ellipsis if truncation is needed.

Parameters
textThe full label string to elide.
Returns
The elided string, or text unchanged if it already fits.

◆ getTickLabel()

QString QCPAxisTickerElided::getTickLabel ( double  tick,
const QLocale &  locale,
QChar  formatChar,
int  precision 
)
overrideprotectedvirtual

Returns the (possibly elided) label string for the tick at tick.

Overrides QCPAxisTickerText to apply elision before the label is rendered.

Parameters
tickAxis coordinate of the tick being labelled.
localeLocale used for number formatting.
formatCharprintf-style format character for numeric ticks.
precisionNumber of decimal places for numeric tick labels.
Returns
Elided tick label string.

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