diff --git a/src/plotcontrolpanel.cpp b/src/plotcontrolpanel.cpp --- a/src/plotcontrolpanel.cpp +++ b/src/plotcontrolpanel.cpp @@ -386,6 +386,7 @@ void PlotControlPanel::saveSettings(QSet { settings->beginGroup(SettingGroup_Plot); settings->setValue(SG_Plot_NumOfSamples, numOfSamples()); + settings->setValue(SG_Plot_PlotWidth, ui->spPlotWidth->value()); settings->setValue(SG_Plot_IndexAsX, xAxisAsIndex()); settings->setValue(SG_Plot_XMax, xMax()); settings->setValue(SG_Plot_XMin, xMin()); @@ -400,6 +401,8 @@ void PlotControlPanel::loadSettings(QSet settings->beginGroup(SettingGroup_Plot); ui->spNumOfSamples->setValue( settings->value(SG_Plot_NumOfSamples, numOfSamples()).toInt()); + ui->spPlotWidth->setValue( + settings->value(SG_Plot_PlotWidth, ui->spPlotWidth->value()).toInt()); ui->cbIndex->setChecked( settings->value(SG_Plot_IndexAsX, xAxisAsIndex()).toBool()); ui->spXmax->setValue(settings->value(SG_Plot_XMax, xMax()).toDouble()); diff --git a/src/plotcontrolpanel.h b/src/plotcontrolpanel.h --- a/src/plotcontrolpanel.h +++ b/src/plotcontrolpanel.h @@ -46,6 +46,7 @@ public: bool xAxisAsIndex() const; double xMax() const; double xMin() const; + /// Returns the plot width adjusted for x axis scaling. double plotWidth() const; void setChannelInfoModel(ChannelInfoModel* model); diff --git a/src/setting_defines.h b/src/setting_defines.h --- a/src/setting_defines.h +++ b/src/setting_defines.h @@ -76,6 +76,7 @@ const char SG_Channels_Visible[] = "visi // plot settings keys const char SG_Plot_NumOfSamples[] = "numOfSamples"; +const char SG_Plot_PlotWidth[] = "plotWidth"; const char SG_Plot_IndexAsX[] = "indexAsX"; const char SG_Plot_XMax[] = "xMax"; const char SG_Plot_XMin[] = "xMin";