diff options
| author | Nikita Kostovsky <luntik2012@gmail.com> | 2024-12-02 19:42:40 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <luntik2012@gmail.com> | 2024-12-02 19:42:40 +0100 |
| commit | 8f383df0c295e1049bcf2211869e0b069fb3890e (patch) | |
| tree | e55f09abca9aaed78bd413e1acd35f8aa611ba83 /QmlCustomPlot.cpp | |
| parent | 05a8166fa1ada3b386a4e0cce30c60f396587476 (diff) | |
draw lines
Diffstat (limited to 'QmlCustomPlot.cpp')
| -rw-r--r-- | QmlCustomPlot.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/QmlCustomPlot.cpp b/QmlCustomPlot.cpp index ef30b3f..bba287e 100644 --- a/QmlCustomPlot.cpp +++ b/QmlCustomPlot.cpp @@ -127,7 +127,8 @@ void QmlCustomPlot::setLines(const QVector<QLineF> lines) // const QColor color(Qt::green); // QRgb green = QRandomGenerator::generate(); // QRgb blue = QRandomGenerator::generate(); - const QColor color { QRgb { QRandomGenerator::global()->generate() } }; + QColor color { QRgb { QRandomGenerator::global()->generate() } }; + color.setAlpha(100); const QPen linePen(color, 4); QCPItemLine * l; @@ -145,7 +146,8 @@ void QmlCustomPlot::setLines(const QVector<QLineF> lines) l = m_lineItems[i]; } - const QPointF offset(0, 2); + // const QPointF offset(0, 2); + const QPointF offset(0, 0); const auto & lineToSet = lines.at(i); l->start->setCoords(lineToSet.p1() + offset); |
