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

View File

@ -105,9 +105,9 @@ private:
*/ */
qint32 column; 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 * @brief FillIncrementTable fill data for increment table
*/ */

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>897</width> <width>897</width>
<height>422</height> <height>566</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -20,7 +20,7 @@
<string>Increments</string> <string>Increments</string>
</property> </property>
<property name="windowIcon"> <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> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="locale"> <property name="locale">
@ -39,14 +39,109 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabStandard"> <widget class="QWidget" name="tabStandard">
<attribute name="title"> <attribute name="title">
<string>Sizes table</string> <string>Measurements</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item row="0" column="0"> <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"> <widget class="QTableWidget" name="tableWidgetStandard">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
@ -112,7 +207,7 @@
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string>In growths</string> <string>In heights</string>
</property> </property>
</column> </column>
<column> <column>
@ -192,7 +287,7 @@
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string>In growths</string> <string>In heights</string>
</property> </property>
</column> </column>
<column> <column>
@ -353,7 +448,6 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>tableWidgetStandard</tabstop> <tabstop>tableWidgetStandard</tabstop>
<tabstop>tableWidgetIncrement</tabstop> <tabstop>tableWidgetIncrement</tabstop>
<tabstop>toolButtonAdd</tabstop> <tabstop>toolButtonAdd</tabstop>
@ -363,7 +457,7 @@
<tabstop>tableWidgetArcs</tabstop> <tabstop>tableWidgetArcs</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../../share/resources/icon.qrc"/> <include location="../../../share/resources/icon.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>