Skip to content

Commit

Permalink
allowe resetting individual y-axis for selected plot
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderOrb committed Jul 11, 2024
1 parent bc23c7b commit f877043
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
14 changes: 14 additions & 0 deletions Source/GUI/yminmaxselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,17 @@ void YMinMaxSelector::on_customMinMax_radioButton_clicked()
updateMinMaxStyling();
}


void YMinMaxSelector::on_reset_pushButton_clicked()
{
QSettings settings;
settings.beginGroup("yminmax");
settings.remove(QString::number(m_plot->group()));
settings.endGroup();

m_plot->setYAxisCustomMinMax(0, 0);
m_plot->loadYAxisMinMaxMode();
m_plot->replot();
hide();
}

2 changes: 2 additions & 0 deletions Source/GUI/yminmaxselector.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private Q_SLOTS:
void on_minMaxSystemProvided_radioButton_clicked();
void on_customMinMax_radioButton_clicked();

void on_reset_pushButton_clicked();

private:
void updateApplyButton();
void updateMinMaxStyling();
Expand Down
41 changes: 24 additions & 17 deletions Source/GUI/yminmaxselector.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>550</width>
<width>579</width>
<height>192</height>
</rect>
</property>
Expand All @@ -17,7 +17,27 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="3">
<item row="1" column="2">
<widget class="QPushButton" name="apply_pushButton">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>132</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="4">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Set the y-axis range</string>
Expand Down Expand Up @@ -177,25 +197,12 @@
</spacer>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="apply_pushButton">
<widget class="QPushButton" name="reset_pushButton">
<property name="text">
<string>Apply</string>
<string>Reset</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>132</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
Expand Down

0 comments on commit f877043

Please sign in to comment.