Refactoring DialogIncrements.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-18 00:03:24 +02:00
parent 44b33ab1cb
commit add722d0c5
3 changed files with 11 additions and 82 deletions

View File

@ -37,11 +37,6 @@ DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0)
{
ui->setupUi(this);
InitialStandardTable();
InitialIncrementTable();
InitialLinesTable();
InitialSplinesTable();
InitialArcsTable();
DoubleSpinBoxDelegate *doubleDelegate = new DoubleSpinBoxDelegate(ui->tableWidgetIncrement);
ui->tableWidgetIncrement->setItemDelegateForColumn(2, doubleDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(3, doubleDelegate);
@ -278,24 +273,19 @@ void DialogIncrements::FullUpdateFromFile()
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
ui->tableWidgetStandard->clear();
InitialStandardTable();
ui->tableWidgetStandard->clearContents();
FillStandardTable();
ui->tableWidgetIncrement->clearContents();
//InitialIncrementTable();
FillIncrementTable();
ui->tableWidgetLines->clear();
InitialLinesTable();
ui->tableWidgetLines->clearContents();
FillLengthLines();
ui->tableWidgetSplines->clear();
InitialSplinesTable();
ui->tableWidgetSplines->clearContents();
FillLengthSplines();
ui->tableWidgetArcs->clear();
InitialArcsTable();
ui->tableWidgetArcs->clearContents();
FillLengthArcs();
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
@ -511,47 +501,6 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
}
}
void DialogIncrements::InitialStandardTable()
{
ui->tableWidgetStandard->setSortingEnabled(false);
ui->tableWidgetStandard->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Name")));
ui->tableWidgetStandard->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Calculated value")));
ui->tableWidgetStandard->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Base value")));
ui->tableWidgetStandard->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("In size")));
ui->tableWidgetStandard->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("In growth")));
ui->tableWidgetStandard->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Description")));
}
void DialogIncrements::InitialIncrementTable()
{
ui->tableWidgetIncrement->setSortingEnabled(false);
ui->tableWidgetIncrement->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Name")));
ui->tableWidgetIncrement->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Calculated value")));
ui->tableWidgetIncrement->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Base value")));
ui->tableWidgetIncrement->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("In size")));
ui->tableWidgetIncrement->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("In growth")));
ui->tableWidgetIncrement->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Description")));
ui->tableWidgetIncrement->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::InitialLinesTable()
{
ui->tableWidgetLines->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Line")));
ui->tableWidgetLines->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Length")));
}
void DialogIncrements::InitialSplinesTable()
{
ui->tableWidgetSplines->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Curve")));
ui->tableWidgetSplines->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Length")));
}
void DialogIncrements::InitialArcsTable()
{
ui->tableWidgetArcs->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Arc")));
ui->tableWidgetArcs->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Length")));
}
void DialogIncrements::closeEvent(QCloseEvent *event)
{
emit DialogClosed(QDialog::Accepted);

View File

@ -104,26 +104,6 @@ private:
* @brief column save number of column current selected cell
*/
qint32 column;
/**
* @brief InitialStandardTable initial option standard table
*/
void InitialStandardTable();
/**
* @brief InitialIncrementTable initial option increment table
*/
void InitialIncrementTable();
/**
* @brief InitialLinesTable initial option lines table
*/
void InitialLinesTable();
/**
* @brief InitialSplinesTable initial option splines table
*/
void InitialSplinesTable();
/**
* @brief InitialArcsTable initial option arcs table
*/
void InitialArcsTable();
/**
* @brief FillStandardTable fill data for standard table
*/

View File

@ -27,7 +27,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>4</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabStandard">
<attribute name="title">
@ -153,7 +153,7 @@
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>45</number>
<number>20</number>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>false</bool>
@ -175,12 +175,12 @@
</column>
<column>
<property name="text">
<string>In size</string>
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In growth</string>
<string>In growths</string>
</property>
</column>
<column>
@ -248,7 +248,7 @@
</column>
<column>
<property name="text">
<string>Length of the line</string>
<string>Length</string>
</property>
</column>
</widget>
@ -284,7 +284,7 @@
</column>
<column>
<property name="text">
<string>Length of the curve</string>
<string>Length</string>
</property>
</column>
</widget>
@ -320,7 +320,7 @@
</column>
<column>
<property name="text">
<string>Length of arc</string>
<string>Length</string>
</property>
</column>
</widget>