From 5d72355dcc529c04ed95ea71155f818bcca6e1fa Mon Sep 17 00:00:00 2001 From: jussi Date: Sun, 20 Jan 2019 20:06:51 +0200 Subject: [PATCH] revert something that broke removing points from the plot --- editprofile.cpp | 24 ++++-------------------- editprofile.ui | 4 ++-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/editprofile.cpp b/editprofile.cpp index 40a0b31..18a314d 100644 --- a/editprofile.cpp +++ b/editprofile.cpp @@ -259,14 +259,8 @@ void editProfile::dragPoint(int index_x, int index_y, QMouseEvent* event) palette.setCurrentColorGroup(QPalette::Active); QColor textColor = palette.color(QPalette::Text); - //coordText->position->setType(QCPItemPosition::ptPlotCoords); - if (ui->curvePlot->xAxis->pixelToCoord(point.x()) < x_upper*0.1) { - coordText->position->setCoords(x_upper*0.1, qv_y[index_y] + 4); - } else if (ui->curvePlot->xAxis->pixelToCoord(point.x()) > x_upper*0.9) { - coordText->position->setCoords(x_upper*0.9, qv_y[index_y] + 4); - } else { - coordText->position->setCoords(qv_x[index_x], qv_y[index_y] + 4); - } + coordText->position->setType(QCPItemPosition::ptPlotCoords); + coordText->position->setCoords(qv_x[index_x], qv_y[index_y] + 4); QString xString = QString::number(qv_x[index_x]); QString yString = QString::number(qv_y[index_y]); coordText->setText(xString + ", " + yString); @@ -321,7 +315,7 @@ void editProfile::on_saveButton_clicked() yString.append(y + ", "); } - /*MainWindow mw; + MainWindow mw; QVariant xarray = xString; QVariant yarray = yString; qDebug() << xarray.toString() << yarray.toString(); @@ -331,17 +325,7 @@ void editProfile::on_saveButton_clicked() ysetting.append("/ypoints"); xsetting.append("/xpoints"); settings.setValue(xsetting, xarray); - settings.setValue(ysetting, yarray); */ - QSettings settings("nvfancurve"); - settings.beginGroup("General"); - QString currentProfile = settings.value("currentProfile").toString(); - QString latestUUID = settings.value("latestUUID").toString(); - qDebug() << latestUUID; - settings.endGroup(); - settings.beginGroup(currentProfile); - settings.beginGroup(latestUUID); - settings.setValue("ypoints", yString); - settings.setValue("xpoints", xString); + settings.setValue(ysetting, yarray); } void editProfile::on_clearButton_clicked() diff --git a/editprofile.ui b/editprofile.ui index 74ebf7a..c2d4fd6 100644 --- a/editprofile.ui +++ b/editprofile.ui @@ -6,8 +6,8 @@ 0 0 - 437 - 457 + 663 + 565