diff options
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -15,7 +15,7 @@ int main( int argc, char *argv[]) { - qputenv("QT_SCALE_FACTOR", "1.5"); + // qputenv("QT_SCALE_FACTOR", "1.5"); QApplication app(argc, argv); qDebug() << qgetenv("QT_QUICK_CONTROLS_MATERIAL_VARIANT"); @@ -49,6 +49,8 @@ int main( QVector<qreal> prev_y_profile; constexpr int img_width = 704; + constexpr int img_height = 544; + for (int x = -img_width / 2; x < img_width / 2; ++x) { double y = double(QRandomGenerator::global()->bounded(0, 80000)) / 100.; @@ -58,6 +60,17 @@ int main( } prev_y_profile = y_pixels; + const auto sensorRect = new QCPItemRect{pixelsPlot}; + sensorRect->setPen(QPen{QColor{Qt::green}, 1}); + const auto srt = QCPItemPosition::ptPlotCoords; + sensorRect->topLeft->setType(srt); + sensorRect->topLeft->setCoords(QPointF{-img_width / 2, img_height}); + sensorRect->bottomRight->setType(srt); + sensorRect->bottomRight->setCoords(QPointF{img_width / 2, 0}); + sensorRect->setBrush(QColor(255, 0, 0, 18)); + sensorRect->setVisible(true); + sensorRect->setSelectable(false); + auto pixelsGraph = pixelsPlot->addGraph(); pixelsGraph->setPen(QPen(QBrush(Qt::red), 2)); pixelsGraph->setLineStyle(QCPGraph::lsNone); @@ -178,7 +191,7 @@ int main( qWarning() << "no pixelsCustomPlot"; } else { // qDebug() << "set lines. count is" << lines.count(); - pixelsCustomPlot->setLines(lines); + // pixelsCustomPlot->setLines(lines); } // 6 780 |
