revert something that broke removing points from the plot

This commit is contained in:
jussi
2019-01-20 20:06:51 +02:00
parent f42caa2bad
commit 5d72355dcc
2 changed files with 6 additions and 22 deletions

View File

@@ -259,14 +259,8 @@ void editProfile::dragPoint(int index_x, int index_y, QMouseEvent* event)
palette.setCurrentColorGroup(QPalette::Active); palette.setCurrentColorGroup(QPalette::Active);
QColor textColor = palette.color(QPalette::Text); QColor textColor = palette.color(QPalette::Text);
//coordText->position->setType(QCPItemPosition::ptPlotCoords); coordText->position->setType(QCPItemPosition::ptPlotCoords);
if (ui->curvePlot->xAxis->pixelToCoord(point.x()) < x_upper*0.1) { coordText->position->setCoords(qv_x[index_x], qv_y[index_y] + 4);
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);
}
QString xString = QString::number(qv_x[index_x]); QString xString = QString::number(qv_x[index_x]);
QString yString = QString::number(qv_y[index_y]); QString yString = QString::number(qv_y[index_y]);
coordText->setText(xString + ", " + yString); coordText->setText(xString + ", " + yString);
@@ -321,7 +315,7 @@ void editProfile::on_saveButton_clicked()
yString.append(y + ", "); yString.append(y + ", ");
} }
/*MainWindow mw; MainWindow mw;
QVariant xarray = xString; QVariant xarray = xString;
QVariant yarray = yString; QVariant yarray = yString;
qDebug() << xarray.toString() << yarray.toString(); qDebug() << xarray.toString() << yarray.toString();
@@ -331,17 +325,7 @@ void editProfile::on_saveButton_clicked()
ysetting.append("/ypoints"); ysetting.append("/ypoints");
xsetting.append("/xpoints"); xsetting.append("/xpoints");
settings.setValue(xsetting, xarray); settings.setValue(xsetting, xarray);
settings.setValue(ysetting, yarray); */ 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);
} }
void editProfile::on_clearButton_clicked() void editProfile::on_clearButton_clicked()

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>437</width> <width>663</width>
<height>457</height> <height>565</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">