diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-02-05 16:50:58 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-02-08 17:32:31 +0000 |
commit | 8f676eb999d69539054281724b572e244cbebd66 (patch) | |
tree | e5612cb962fd417015e6ef01856b759b5a4a55db /ui/qt | |
parent | f4384e6cda716ad7eaf9174c29319ddc25c366f4 (diff) | |
download | wireshark-8f676eb999d69539054281724b572e244cbebd66.tar.gz wireshark-8f676eb999d69539054281724b572e244cbebd66.tar.bz2 wireshark-8f676eb999d69539054281724b572e244cbebd66.zip |
Qt: Restore sequence diagram labels, other fixes.
SequenceDiagram implements time, address, and comment labels using
QCPAxis::setTickVector and QCPAxis::setTickVectorLabels. It also calls
QCPAxis::setTicks(false) so that we don't draw tick marks. It appears
that doing so also disables the labels themselves in our current version
of QCP. Set the tick pen to Qt::NoPen instead.
Only draw node lines where we have nodes.
Add notes about a retina issue and the need for zooming.
Bug: 11710
Change-Id: I88c30a1ddcd29832f86b1ca8c018c7fa6b6d64a7
Reviewed-on: https://code.wireshark.org/review/13781
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
(cherry picked from commit 477769b82370102228056364bef31f2ac74c38b3)
Reviewed-on: https://code.wireshark.org/review/13828
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/sequence_diagram.cpp | 10 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.cpp | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp index 5c1fe116bf..77126feaff 100644 --- a/ui/qt/sequence_diagram.cpp +++ b/ui/qt/sequence_diagram.cpp @@ -67,12 +67,14 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis * // valueAxis->setAutoTickStep(false); QList<QCPAxis *> axes; axes << value_axis_ << key_axis_ << comment_axis_; + QPen no_pen(Qt::NoPen); foreach (QCPAxis *axis, axes) { axis->setAutoTicks(false); axis->setTickStep(1.0); axis->setAutoTickLabels(false); - axis->setTicks(false); - axis->setBasePen(QPen(Qt::NoPen)); + axis->setSubTickPen(no_pen); + axis->setTickPen(no_pen); + axis->setBasePen(no_pen); } value_axis_->grid()->setVisible(false); @@ -192,6 +194,8 @@ void SequenceDiagram::draw(QCPPainter *painter) fg_pen.setStyle(Qt::DashLine); painter->setPen(fg_pen); for (int ll_x = value_axis_->range().lower; ll_x < value_axis_->range().upper; ll_x++) { + // Only draw where we have arrows. + if (ll_x < 0 || ll_x >= value_axis_->tickVector().size()) continue; QPoint ll_start(coordsToPixels(key_axis_->range().upper, ll_x).toPoint()); QPoint ll_end(coordsToPixels(key_axis_->range().lower, ll_x).toPoint()); painter->drawLine(ll_start, ll_end); @@ -222,6 +226,8 @@ void SequenceDiagram::draw(QCPPainter *painter) painter->setPen(hl_pen); painter->setOpacity(alpha); for (int ll_x = value_axis_->range().lower; ll_x < value_axis_->range().upper; ll_x++) { + // Only draw where we have arrows. + if (ll_x < 0 || ll_x >= value_axis_->tickVector().size()) continue; QPoint ll_start(coordsToPixels(cur_key - 0.5, ll_x).toPoint()); QPoint ll_end(coordsToPixels(cur_key + 0.5, ll_x).toPoint()); hl_pen.setDashOffset(bg_rect.top() - ll_start.x()); diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp index 50f7e6ec9a..02aebae567 100644 --- a/ui/qt/sequence_dialog.cpp +++ b/ui/qt/sequence_dialog.cpp @@ -46,6 +46,8 @@ // - Change line_style to seq_type (i.e. draw ACKs dashed) // - Create WSGraph subclasses with common behavior. // - Help button and text +// - Diagram shrinks when you click on it on retina displays. +// - Add zoom controls. SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *info) : WiresharkDialog(parent, cf), |