Show lines angle in list of variables.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-05-30 13:58:27 +03:00
parent 5f977c640e
commit d6c90d1bcc
3 changed files with 64 additions and 15 deletions

View File

@ -94,6 +94,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
FillMeasurements(); FillMeasurements();
FillIncrements(); FillIncrements();
FillLengthLines(); FillLengthLines();
FillLengthLinesAngle();
FillLengthSplines(); FillLengthSplines();
FillLengthArcs(); FillLengthArcs();
@ -355,6 +356,12 @@ void DialogIncrements::FillLengthLines()
FillTable(data->DataLengthLines(), ui->tableWidgetLines); FillTable(data->DataLengthLines(), ui->tableWidgetLines);
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::FillLengthLinesAngle()
{
FillTable(data->DataAngleLines(), ui->tableWidgetLinesAngle);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief FillLengthSplines fill data for table of splines lengths * @brief FillLengthSplines fill data for table of splines lengths
@ -385,25 +392,27 @@ void DialogIncrements::SetItemViewOnly(QTableWidgetItem *item)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowUnits() void DialogIncrements::ShowUnits()
{ {
ShowHeaderUnits(ui->tableWidgetIncrement, 2);// base value const QString unit = VDomDocument::UnitsToStr(qApp->patternUnit());
ShowHeaderUnits(ui->tableWidgetIncrement, 3);// in sizes
ShowHeaderUnits(ui->tableWidgetIncrement, 4);// in heights
ShowHeaderUnits(ui->tableWidgetMeasurements, 2);// base value ShowHeaderUnits(ui->tableWidgetIncrement, 2, unit);// base value
ShowHeaderUnits(ui->tableWidgetMeasurements, 3);// in sizes ShowHeaderUnits(ui->tableWidgetIncrement, 3, unit);// in sizes
ShowHeaderUnits(ui->tableWidgetMeasurements, 4);// in heights ShowHeaderUnits(ui->tableWidgetIncrement, 4, unit);// in heights
ShowHeaderUnits(ui->tableWidgetLines, 1);// lengths ShowHeaderUnits(ui->tableWidgetMeasurements, 2, unit);// base value
ShowHeaderUnits(ui->tableWidgetSplines, 1);// lengths ShowHeaderUnits(ui->tableWidgetMeasurements, 3, unit);// in sizes
ShowHeaderUnits(ui->tableWidgetArcs, 1);// lengths ShowHeaderUnits(ui->tableWidgetMeasurements, 4, unit);// in heights
ShowHeaderUnits(ui->tableWidgetLines, 1, unit);// lengths
ShowHeaderUnits(ui->tableWidgetSplines, 1, unit);// lengths
ShowHeaderUnits(ui->tableWidgetArcs, 1, unit);// lengths
ShowHeaderUnits(ui->tableWidgetLinesAngle, 1, "°");// lengths
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column) void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit)
{ {
SCASSERT(table != nullptr); SCASSERT(table != nullptr);
const QString unit = VDomDocument::UnitsToStr(qApp->patternUnit());
const QString header = table->horizontalHeaderItem(column)->text(); const QString header = table->horizontalHeaderItem(column)->text();
const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit); const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit);
table->horizontalHeaderItem(column)->setText(unitHeader); table->horizontalHeaderItem(column)->setText(unitHeader);

View File

@ -99,6 +99,7 @@ private:
template <typename T> template <typename T>
void FillTable(const QMap<QString, T> varTable, QTableWidget *table); void FillTable(const QMap<QString, T> varTable, QTableWidget *table);
void FillLengthLines(); void FillLengthLines();
void FillLengthLinesAngle();
void FillLengthSplines(); void FillLengthSplines();
void FillLengthArcs(); void FillLengthArcs();
void AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, void AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base,
@ -106,7 +107,7 @@ private:
void HideColumns(QTableWidget *table); void HideColumns(QTableWidget *table);
void SetItemViewOnly(QTableWidgetItem *item); void SetItemViewOnly(QTableWidgetItem *item);
void ShowUnits(); void ShowUnits();
void ShowHeaderUnits(QTableWidget *table, int column); void ShowHeaderUnits(QTableWidget *table, int column, const QString &unit);
void ShowSuccess() const; void ShowSuccess() const;
}; };

View File

@ -39,7 +39,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="tabStandard"> <widget class="QWidget" name="tabStandard">
<property name="sizePolicy"> <property name="sizePolicy">
@ -118,8 +118,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>939</width> <width>559</width>
<height>411</height> <height>82</height>
</rect> </rect>
</property> </property>
<attribute name="icon"> <attribute name="icon">
@ -548,6 +548,45 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Lines angle</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetLinesAngle">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Line</string>
</property>
</column>
<column>
<property name="text">
<string>Angle</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4"> <widget class="QWidget" name="tab_4">
<attribute name="title"> <attribute name="title">
<string>Curves</string> <string>Curves</string>