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:13 +0000 |
commit | 477769b82370102228056364bef31f2ac74c38b3 (patch) | |
tree | 1b4a4436df1d91d0a596e9f1910c5bc92796e2b1 /ui/qt/sequence_diagram.cpp | |
parent | ddc8a49d184bfeae232ee2b3984ac83408018eaf (diff) | |
download | wireshark-477769b82370102228056364bef31f2ac74c38b3.tar.gz |
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>
Diffstat (limited to 'ui/qt/sequence_diagram.cpp')
-rw-r--r-- | ui/qt/sequence_diagram.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp index 764474b3e7..1beab92659 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()); |