Show a piece position status in Property tab.
This commit is contained in:
parent
537efbeaa8
commit
ed4f2945da
|
@ -883,6 +883,17 @@ void VPMainWindow::InitPropertyTabCurrentPiece()
|
||||||
connect(ui->checkBoxCurrentPieceHorizontallyFlipped, &QCheckBox::toggled, this,
|
connect(ui->checkBoxCurrentPieceHorizontallyFlipped, &QCheckBox::toggled, this,
|
||||||
&VPMainWindow::CurrentPieceHorizontallyFlippedToggled);
|
&VPMainWindow::CurrentPieceHorizontallyFlippedToggled);
|
||||||
|
|
||||||
|
const QIcon warningIcon = QIcon::fromTheme(QStringLiteral("dialog-warning"));
|
||||||
|
auto WarningIcon = [warningIcon](QLabel *label)
|
||||||
|
{
|
||||||
|
const int size = qRound(16 * label->devicePixelRatio());
|
||||||
|
label->setPixmap(warningIcon.pixmap(size, size));
|
||||||
|
};
|
||||||
|
|
||||||
|
WarningIcon(ui->labelWarningOutOfBound);
|
||||||
|
WarningIcon(ui->labelWarningSuperpositionOfPieces);
|
||||||
|
WarningIcon(ui->labelWarningPieceGape);
|
||||||
|
|
||||||
// Translate
|
// Translate
|
||||||
ui->comboBoxTranslateUnit->addItem(tr("Millimiters"), QVariant(UnitsToStr(Unit::Mm)));
|
ui->comboBoxTranslateUnit->addItem(tr("Millimiters"), QVariant(UnitsToStr(Unit::Mm)));
|
||||||
ui->comboBoxTranslateUnit->addItem(tr("Centimeters"), QVariant(UnitsToStr(Unit::Cm)));
|
ui->comboBoxTranslateUnit->addItem(tr("Centimeters"), QVariant(UnitsToStr(Unit::Cm)));
|
||||||
|
@ -1356,12 +1367,14 @@ void VPMainWindow::SetPropertyTabCurrentPieceData()
|
||||||
ui->labelCurrentPieceNoPieceSelected->setVisible(true);
|
ui->labelCurrentPieceNoPieceSelected->setVisible(true);
|
||||||
|
|
||||||
ui->groupBoxCurrentPieceInfo->setVisible(false);
|
ui->groupBoxCurrentPieceInfo->setVisible(false);
|
||||||
|
ui->groupBoxCurrentPieceStatus->setVisible(false);
|
||||||
ui->groupBoxPieceTransformation->setVisible(false);
|
ui->groupBoxPieceTransformation->setVisible(false);
|
||||||
ui->groupBoxCurrentPieceGeometry->setVisible(false);
|
ui->groupBoxCurrentPieceGeometry->setVisible(false);
|
||||||
}
|
}
|
||||||
else if (selectedPieces.count() == 1)
|
else if (selectedPieces.count() == 1)
|
||||||
{
|
{
|
||||||
ui->groupBoxCurrentPieceInfo->setVisible(true);
|
ui->groupBoxCurrentPieceInfo->setVisible(true);
|
||||||
|
ui->groupBoxCurrentPieceStatus->setVisible(true);
|
||||||
ui->groupBoxPieceTransformation->setVisible(true);
|
ui->groupBoxPieceTransformation->setVisible(true);
|
||||||
ui->groupBoxCurrentPieceGeometry->setVisible(true);
|
ui->groupBoxCurrentPieceGeometry->setVisible(true);
|
||||||
|
|
||||||
|
@ -1373,6 +1386,10 @@ void VPMainWindow::SetPropertyTabCurrentPieceData()
|
||||||
SetLineEditValue(ui->lineEditCurrentPieceGradationId, selectedPiece->GetGradationId());
|
SetLineEditValue(ui->lineEditCurrentPieceGradationId, selectedPiece->GetGradationId());
|
||||||
SetLineEditValue(ui->lineEditCopyNumber, QString::number(selectedPiece->CopyNumber()));
|
SetLineEditValue(ui->lineEditCopyNumber, QString::number(selectedPiece->CopyNumber()));
|
||||||
|
|
||||||
|
ui->labelWarningOutOfBound->setEnabled(selectedPiece->OutOfBound());
|
||||||
|
ui->labelWarningSuperpositionOfPieces->setEnabled(selectedPiece->HasSuperpositionWithPieces());
|
||||||
|
ui->labelWarningPieceGape->setEnabled(selectedPiece->HasInvalidPieceGapPosition());
|
||||||
|
|
||||||
SetCheckBoxValue(ui->checkBoxCurrentPieceShowSeamline, not selectedPiece->IsHideMainPath());
|
SetCheckBoxValue(ui->checkBoxCurrentPieceShowSeamline, not selectedPiece->IsHideMainPath());
|
||||||
SetCheckBoxValue(ui->checkBoxCurrentPieceVerticallyFlipped, selectedPiece->IsVerticallyFlipped());
|
SetCheckBoxValue(ui->checkBoxCurrentPieceVerticallyFlipped, selectedPiece->IsVerticallyFlipped());
|
||||||
SetCheckBoxValue(ui->checkBoxCurrentPieceHorizontallyFlipped, selectedPiece->IsHorizontallyFlipped());
|
SetCheckBoxValue(ui->checkBoxCurrentPieceHorizontallyFlipped, selectedPiece->IsHorizontallyFlipped());
|
||||||
|
@ -1401,6 +1418,7 @@ void VPMainWindow::SetPropertyTabCurrentPieceData()
|
||||||
{
|
{
|
||||||
// show the content "multiple pieces selected"
|
// show the content "multiple pieces selected"
|
||||||
ui->groupBoxCurrentPieceInfo->setVisible(false);
|
ui->groupBoxCurrentPieceInfo->setVisible(false);
|
||||||
|
ui->groupBoxCurrentPieceStatus->setVisible(false);
|
||||||
ui->groupBoxPieceTransformation->setVisible(true);
|
ui->groupBoxPieceTransformation->setVisible(true);
|
||||||
ui->groupBoxCurrentPieceGeometry->setVisible(false);
|
ui->groupBoxCurrentPieceGeometry->setVisible(false);
|
||||||
|
|
||||||
|
|
|
@ -279,8 +279,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>378</width>
|
<width>385</width>
|
||||||
<height>752</height>
|
<height>865</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||||
|
@ -395,6 +395,57 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBoxCurrentPieceStatus">
|
||||||
|
<property name="title">
|
||||||
|
<string>Status</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelWarningOutOfBound">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Warning!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>Out of bound</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelWarningSuperpositionOfPieces">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Warning!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="text">
|
||||||
|
<string>Superposition of pieces</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelWarningPieceGape">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Warning!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="label_16">
|
||||||
|
<property name="text">
|
||||||
|
<string>Piece gape</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxPieceTransformation">
|
<widget class="QGroupBox" name="groupBoxPieceTransformation">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -752,7 +803,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>378</width>
|
<width>385</width>
|
||||||
<height>829</height>
|
<height>829</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1276,7 +1327,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>399</width>
|
||||||
<height>700</height>
|
<height>700</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1659,7 +1710,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>378</width>
|
<width>385</width>
|
||||||
<height>710</height>
|
<height>710</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -2455,8 +2506,8 @@
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
|
<buttongroup name="buttonGroupRotationDirection"/>
|
||||||
<buttongroup name="buttonGroupTileOrientation"/>
|
<buttongroup name="buttonGroupTileOrientation"/>
|
||||||
<buttongroup name="buttonGroupSheetOrientation"/>
|
<buttongroup name="buttonGroupSheetOrientation"/>
|
||||||
<buttongroup name="buttonGroupRotationDirection"/>
|
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -615,7 +615,7 @@ auto DialogWarningIcon() -> QString
|
||||||
QByteArray byteArray;
|
QByteArray byteArray;
|
||||||
QBuffer buffer(&byteArray);
|
QBuffer buffer(&byteArray);
|
||||||
pixmap.save(&buffer, "PNG");
|
pixmap.save(&buffer, "PNG");
|
||||||
return QStringLiteral("<img src=\"data:image/png;base64,") + byteArray.toBase64() + QStringLiteral("\"/> ");
|
return QStringLiteral("<img src=\"data:image/png;base64,") + byteArray.toBase64() + "\"/> "_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user