From c1102a38f359b9c155183a39fb059870d63e1d6d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 27 Nov 2013 21:24:48 -0200 Subject: [PATCH] More gradient on the partial pressure graph. This patch adds a bit more of gradient on the lines for the partal pressure graph grid, it also moves a tiny bit to the side the even numbers so it's easyer to read when they are too near each other. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profilegraphics.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 766f7cd5e..de3e9cd59 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -545,17 +545,26 @@ void ProfileGraphicsView::plot_pp_text() setup_pp_limits(&gc); pp = floor(gc.pi.maxpp * 10.0) / 10.0 + 0.2; - dpp = pp > 4 ? 1.0 : 0.5; + dpp = pp > 4 ? 0.5 : 0.2; hpos = gc.pi.entry[gc.pi.nr - 1].sec; QColor c = getColor(PP_LINES); + bool alt = false; for (m = 0.0; m <= pp; m += dpp) { QGraphicsLineItem *item = new QGraphicsLineItem(SCALEGC(0, m), SCALEGC(hpos, m)); QPen pen(defaultPen); pen.setColor(c); + if ( QString::number(m).toDouble() != QString::number(m).toInt()){ + pen.setStyle(Qt::DashLine); + pen.setWidthF(1.2); + } item->setPen(pen); scene()->addItem(item); - plot_text(&tro, QPointF(hpos, m), QString::number(m), pressureMarkers); + qreal textPos = hpos; + if (alt) + textPos += 30; + alt = !alt; + plot_text(&tro, QPointF(textPos, m), QString::number(m), pressureMarkers); } scene()->addItem(pressureMarkers); pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0);