| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
qcp_axis_ticker_si.h
Go to the documentation of this file.
1
14
15#ifndef QCP_AXIS_TICKER_SI_H
16#define QCP_AXIS_TICKER_SI_H
17
18#include <ui/qt/widgets/qcustomplot.h>
19
20#include <wsutil/str_util.h>
21
27 class QCPAxisTickerSi : public QCPAxisTickerLog
28{
29 public:
37 explicit QCPAxisTickerSi(format_size_units_e unit = FORMAT_SIZE_UNIT_PACKETS, QString customUnit = QString(), bool log = false);
38
43 format_size_units_e getUnit() const { return mUnit; }
44
49 void setUnit(format_size_units_e unit);
50
55 void setCustomUnit(QString unit);
56
61 void setLog(bool log);
62
63 protected:
72 virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) override;
73
83 virtual int getSubTickCount(double tickStep) override;
84
95 virtual QVector<double> createTickVector(double tickStep, const QCPRange &range) override;
96
97 format_size_units_e mUnit;
98 QString mCustomUnit;
99 bool mLog;
100};
101
102#endif
QCPAxisTickerSi::mUnit
format_size_units_e mUnit
Definition qcp_axis_ticker_si.h:97
QCPAxisTickerSi::getUnit
format_size_units_e getUnit() const
Returns the current unit system used for label formatting.
Definition qcp_axis_ticker_si.h:43
QCPAxisTickerSi::getSubTickCount
virtual int getSubTickCount(double tickStep) override
Returns the number of sub-ticks to place between two major ticks.
Definition qcp_axis_ticker_si.cpp:43
QCPAxisTickerSi::setLog
void setLog(bool log)
Enables or disables logarithmic tick spacing.
Definition qcp_axis_ticker_si.cpp:71
QCPAxisTickerSi::createTickVector
virtual QVector< double > createTickVector(double tickStep, const QCPRange &range) override
Generates the vector of major tick positions for the given range.
Definition qcp_axis_ticker_si.cpp:52
QCPAxisTickerSi::setCustomUnit
void setCustomUnit(QString unit)
Sets a custom unit suffix used when the unit is FORMAT_SIZE_UNIT_CUSTOM.
Definition qcp_axis_ticker_si.cpp:66
QCPAxisTickerSi::QCPAxisTickerSi
QCPAxisTickerSi(format_size_units_e unit=FORMAT_SIZE_UNIT_PACKETS, QString customUnit=QString(), bool log=false)
Constructs a QCPAxisTickerSi.
Definition qcp_axis_ticker_si.cpp:22
QCPAxisTickerSi::getTickLabel
virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) override
Returns the SI-prefixed, unit-annotated label for the tick at tick.
Definition qcp_axis_ticker_si.cpp:27
QCPAxisTickerSi::mCustomUnit
QString mCustomUnit
Definition qcp_axis_ticker_si.h:98
QCPAxisTickerSi::mLog
bool mLog
Definition qcp_axis_ticker_si.h:99
QCPAxisTickerSi::setUnit
void setUnit(format_size_units_e unit)
Sets the unit system used for label formatting and invalidates cached ticks.
Definition qcp_axis_ticker_si.cpp:61
str_util.h
format_size_units_e
format_size_units_e
Unit types used by format_size_wmem() for formatting size values.
Definition str_util.h:338
FORMAT_SIZE_UNIT_PACKETS
@ FORMAT_SIZE_UNIT_PACKETS
Definition str_util.h:350