diff options
author | Jim Young <jyoung@gsu.edu> | 2015-11-24 10:50:08 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-01-24 00:13:42 +0000 |
commit | 0fa13371d19e1d33fc43a0d3be14bdb705e437e1 (patch) | |
tree | 159067363abe7e36dc7a55efb671ec26a68c9102 /ui/qt/qcustomplot.h | |
parent | 9eda2fa063569c49ce238d6bbee023c91b46d879 (diff) |
Qt io_graph: Use Interval value when generating Y-axis label or legend
The I/O Graph allows the user to choose from several different Y-axis units.
Three of the selectable Y-axis units unconditionally imply a per-second
time unit (/s) regardless of the actual I/O Graph Interval value selected.
In addition the Y-axis label includes the “/s” as a suffix regardless of the
current Interval value.
This patch removes "/s" suffix from the Y-axis pick-list units. This patch
also dynamically adds the selected Interval value to the Y-Axis label or
alternatively as the first line of the legend box that is displayed if the
various enabled graphs have differing Y-axis values. For readability the
pick-list values for sub-second Interval values are changed to 1 ms, 10 ms
and 100 ms from the original pick-list values of 0.001 sec, 0.01 sec and
0.1 sec respectively.
To support adding a “Title” to the legend, the QCustomPlot widget is
augmented with “Legend Title” source authored by “David” as posted at:
http://www.qcustomplot.com/index.php/support/forum/443
Note: This patch changes the valid Y-axis unit values stored within the
io_graphs preferences files. Any io_graphs files having entries with the
now obsolete Y-Axis values of “Packets/s”, “Bytes/s” or “Bits/s“ will be
silently upgraded to “Packets”, "Bytes" and "Bits" respectively when
saved.
Bug: 11855
Change-Id: I503ff6dc20b09d90f087342084fb0db6e0080c7f
Reviewed-on: https://code.wireshark.org/review/12219
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/qcustomplot.h')
-rw-r--r-- | ui/qt/qcustomplot.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/qt/qcustomplot.h b/ui/qt/qcustomplot.h index af32bc3bf3..47b3cc2e93 100644 --- a/ui/qt/qcustomplot.h +++ b/ui/qt/qcustomplot.h @@ -3765,5 +3765,26 @@ protected: QPen mainPen() const; }; +// Legend Title - Added to Wireshark +// From: http://www.qcustomplot.com/index.php/support/forum/443 + +class QCPStringLegendItem : public QCPAbstractLegendItem +{ + Q_OBJECT + +public: + explicit QCPStringLegendItem(QCPLegend *pParent, const QString& strText); + + QString text() const; + void setText(const QString& strText); + +protected: + virtual void draw(QCPPainter *painter); + virtual QSize minimumSizeHint() const; + +private: + QString m_strText; +}; + #endif // QCUSTOMPLOT_H |