Dialog: remove Discard + Improve "Min mass"

This commit is contained in:
Clement Jamin 2015-11-23 16:26:01 +01:00
parent e0e97f3b1d
commit c4781ac645
4 changed files with 18 additions and 45 deletions

View File

@ -18,6 +18,9 @@
<layout class="QGridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="GlViewer" name="viewer" native="true">
<property name="focusPolicy">
@ -29,47 +32,32 @@
</widget>
</item>
<item>
<layout class="QVBoxLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Min. mass</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QSlider" name="min_mass_slider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Discard</string>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="discard_spinbox">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
@ -648,10 +636,6 @@
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>min_mass_slider</tabstop>
<tabstop>discard_spinbox</tabstop>
</tabstops>
<resources>
<include location="pwsrec.qrc"/>
</resources>

View File

@ -120,10 +120,6 @@ public:
m_min_mass = min_value;
}
void set_nb_edges_to_ignore(int nb) {
m_ignore = nb;
}
void set_percentage(double percentage) {
m_percentage = percentage;
}

View File

@ -42,7 +42,6 @@ maxNumRecentFiles(15), recentFileActs(15)
addRecentFiles(menuFile, actionQuit);
connect(actionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(min_mass_slider, SIGNAL(valueChanged(int)), this, SLOT(update()));
connect(discard_spinbox, SIGNAL(valueChanged(int)), this, SLOT(update()));
connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString)));
}
@ -154,7 +153,6 @@ void MainWindow::save(const QString& filename)
void MainWindow::update()
{
m_scene->set_min_mass(min_mass());
m_scene->set_nb_edges_to_ignore(ignore_edges());
m_scene->set_percentage(percentage());
viewer->repaint();
}

View File

@ -56,11 +56,6 @@ public:
return value / max_value;
}
int ignore_edges() const
{
return discard_spinbox->value();
}
protected Q_SLOTS:
// drag and drop
void dropEvent(QDropEvent *event);