Refactoring dialog increment.

--HG--
branch : feature
This commit is contained in:
dismine 2014-03-17 20:13:39 +02:00
parent 9584192ec7
commit f641894abd
3 changed files with 112 additions and 18 deletions

View File

@ -45,7 +45,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
ui->tableWidgetIncrement->setItemDelegateForColumn(3, doubleDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(4, doubleDelegate);
FillStandardTable();
FillMeasurements();
FillIncrementTable();
FillLengthLines();
FillLengthSplines();
@ -62,12 +62,12 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
ui->tabWidget->setCurrentIndex(0);
}
void DialogIncrements::FillStandardTable()
void DialogIncrements::FillMeasurements()
{
const QHash<QString, VMeasurement> *standardTable = data->DataMeasurements();
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
qint32 currentRow = -1;
QHashIterator<QString, VMeasurement> i(*standardTable);
ui->tableWidgetStandard->setRowCount ( standardTable->size() );
QHashIterator<QString, VMeasurement> i(*table);
ui->tableWidgetStandard->setRowCount ( table->size() );
while (i.hasNext())
{
i.next();
@ -276,7 +276,7 @@ void DialogIncrements::FullUpdateFromFile()
&DialogIncrements::cellChanged);
ui->tableWidgetStandard->clearContents();
FillStandardTable();
FillMeasurements();
ui->tableWidgetIncrement->clearContents();
FillIncrementTable();

View File

@ -105,9 +105,9 @@ private:
*/
qint32 column;
/**
* @brief FillStandardTable fill data for standard table
* @brief FillMeasurements load measurements data
*/
void FillStandardTable();
void FillMeasurements();
/**
* @brief FillIncrementTable fill data for increment table
*/

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>897</width>
<height>422</height>
<height>566</height>
</rect>
</property>
<property name="minimumSize">
@ -20,7 +20,7 @@
<string>Increments</string>
</property>
<property name="windowIcon">
<iconset resource="../../share/resources/icon.qrc">
<iconset resource="../../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<property name="locale">
@ -39,14 +39,109 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabStandard">
<attribute name="title">
<string>Sizes table</string>
<string>Measurements</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Load another measurements table</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonAnotherTable">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="document-open"/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Family name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Given name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Birth date</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Sex</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_4"/>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="tableWidgetStandard">
<property name="enabled">
<bool>true</bool>
@ -112,7 +207,7 @@
</column>
<column>
<property name="text">
<string>In growths</string>
<string>In heights</string>
</property>
</column>
<column>
@ -192,7 +287,7 @@
</column>
<column>
<property name="text">
<string>In growths</string>
<string>In heights</string>
</property>
</column>
<column>
@ -353,7 +448,6 @@
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>tableWidgetStandard</tabstop>
<tabstop>tableWidgetIncrement</tabstop>
<tabstop>toolButtonAdd</tabstop>
@ -363,7 +457,7 @@
<tabstop>tableWidgetArcs</tabstop>
</tabstops>
<resources>
<include location="../../share/resources/icon.qrc"/>
<include location="../../../share/resources/icon.qrc"/>
</resources>
<connections/>
</ui>