Move all grainline objects inside a group box.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-02-24 17:21:17 +02:00
parent d9bf2d5d6c
commit 3a2752ef37
2 changed files with 450 additions and 490 deletions

View file

@ -212,7 +212,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
UpdateList();
ui->checkBoxGrainline->setChecked(piece.GetGrainlineGeometry().IsVisible());
ui->groupBoxGrainline->setChecked(piece.GetGrainlineGeometry().IsVisible());
ui->lineEditRotFormula->setPlainText(piece.GetGrainlineGeometry().GetRotation());
ui->lineEditLenFormula->setPlainText(piece.GetGrainlineGeometry().GetLength());
ui->comboBoxArrow->setCurrentIndex(int(piece.GetGrainlineGeometry().GetArrowType()));
@ -1072,14 +1072,7 @@ void DialogSeamAllowance::SetEditMode()
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::EnableGrainlineRotation()
{
ui->lineEditRotFormula->setEnabled(ui->checkBoxGrainline->isChecked());
ui->lineEditLenFormula->setEnabled(ui->checkBoxGrainline->isChecked());
ui->pushButtonRot->setEnabled(ui->checkBoxGrainline->isChecked());
ui->pushButtonLen->setEnabled(ui->checkBoxGrainline->isChecked());
ui->pushButtonShowLen->setEnabled(ui->checkBoxGrainline->isChecked());
ui->pushButtonShowRot->setEnabled(ui->checkBoxGrainline->isChecked());
if (ui->checkBoxGrainline->isChecked() == true)
if (ui->groupBoxGrainline->isChecked() == true)
{
UpdateValues();
}
@ -1410,7 +1403,7 @@ VPiece DialogSeamAllowance::CreatePiece() const
piece.GetPatternInfo().SetBottomRightPin(getCurrentObjectId(ui->comboBoxPatternLabelBottomRightPin));
piece.GetGrainlineGeometry() = m_oldGrainline;
piece.GetGrainlineGeometry().SetVisible(ui->checkBoxGrainline->isChecked());
piece.GetGrainlineGeometry().SetVisible(ui->groupBoxGrainline->isChecked());
piece.GetGrainlineGeometry().SetRotation(GetFormulaFromUser(ui->lineEditRotFormula));
piece.GetGrainlineGeometry().SetLength(GetFormulaFromUser(ui->lineEditLenFormula));
piece.GetGrainlineGeometry().SetArrowType(static_cast<ArrowType>(ui->comboBoxArrow->currentIndex()));
@ -1867,7 +1860,7 @@ void DialogSeamAllowance::InitPatternPieceDataTab()
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::InitGrainlineTab()
{
connect(ui->checkBoxGrainline, &QCheckBox::toggled, this, &DialogSeamAllowance::EnableGrainlineRotation);
connect(ui->groupBoxGrainline, &QGroupBox::toggled, this, &DialogSeamAllowance::EnableGrainlineRotation);
connect(ui->pushButtonRot, &QPushButton::clicked, this, &DialogSeamAllowance::EditFormula);
connect(ui->pushButtonLen, &QPushButton::clicked, this, &DialogSeamAllowance::EditFormula);
connect(ui->lineEditLenFormula, &QPlainTextEdit::textChanged, this, &DialogSeamAllowance::UpdateValues);

View file

@ -21,7 +21,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>4</number>
</property>
<widget class="QWidget" name="tabMainPath">
<attribute name="title">
@ -1130,18 +1130,19 @@
<attribute name="title">
<string>Grainline</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_10">
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="checkBoxGrainline">
<property name="text">
<widget class="QGroupBox" name="groupBoxGrainline">
<property name="title">
<string>Grainline visible</string>
</property>
</widget>
</item>
</layout>
</item>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item alignment="Qt::AlignLeft">
@ -1533,43 +1534,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Arrows:</string>
</property>
@ -1615,6 +1579,9 @@
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPins">
<attribute name="title">
<string>Pins</string>