Puzzle app. Fix losing selection by piece.
This commit is contained in:
parent
3db18228c8
commit
ff27cb217a
|
@ -46,6 +46,7 @@
|
||||||
- New piece option Follow grainline.
|
- New piece option Follow grainline.
|
||||||
- Validate sheet and layout names before proposing file name.
|
- Validate sheet and layout names before proposing file name.
|
||||||
- Puzzle app. Fix piece position move when update layout data.
|
- Puzzle app. Fix piece position move when update layout data.
|
||||||
|
- Puzzle app. Fix losing selection by piece.
|
||||||
|
|
||||||
# Valentina 0.7.52 September 12, 2022
|
# Valentina 0.7.52 September 12, 2022
|
||||||
- Fix crash when default locale is ru.
|
- Fix crash when default locale is ru.
|
||||||
|
|
|
@ -102,21 +102,32 @@ void VPSheetSceneData::RefreshPieces()
|
||||||
}
|
}
|
||||||
|
|
||||||
VPSheetPtr sheet = layout->GetSheet(m_sheetUuid);
|
VPSheetPtr sheet = layout->GetSheet(m_sheetUuid);
|
||||||
if (not sheet.isNull())
|
if (sheet.isNull())
|
||||||
{
|
{
|
||||||
QList<VPPiecePtr> pieces = sheet->GetPieces();
|
return;
|
||||||
m_graphicsPieces.reserve(pieces.size());
|
}
|
||||||
|
|
||||||
for (const auto &piece : pieces)
|
QList<VPPiecePtr> pieces = sheet->GetPieces();
|
||||||
|
m_graphicsPieces.reserve(pieces.size());
|
||||||
|
|
||||||
|
for (const auto &piece : pieces)
|
||||||
|
{
|
||||||
|
if (piece.isNull())
|
||||||
{
|
{
|
||||||
if (not piece.isNull())
|
continue;
|
||||||
{
|
|
||||||
auto *graphicsPiece = new VPGraphicsPiece(piece);
|
|
||||||
m_graphicsPieces.append(graphicsPiece);
|
|
||||||
m_scene->addItem(graphicsPiece);
|
|
||||||
ConnectPiece(graphicsPiece);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto *graphicsPiece = new VPGraphicsPiece(piece);
|
||||||
|
m_graphicsPieces.append(graphicsPiece);
|
||||||
|
m_scene->addItem(graphicsPiece);
|
||||||
|
|
||||||
|
// Restore selection state
|
||||||
|
if (piece->IsSelected())
|
||||||
|
{
|
||||||
|
graphicsPiece->setSelected(piece->IsSelected());
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectPiece(graphicsPiece);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +326,7 @@ void VPSheetSceneData::ConnectPiece(VPGraphicsPiece *piece)
|
||||||
QObject::connect(layout.data(), &VPLayout::PieceTransformationChanged, piece, &VPGraphicsPiece::on_RefreshPiece);
|
QObject::connect(layout.data(), &VPLayout::PieceTransformationChanged, piece, &VPGraphicsPiece::on_RefreshPiece);
|
||||||
QObject::connect(layout.data(), &VPLayout::PieceZValueChanged, piece, &VPGraphicsPiece::PieceZValueChanged);
|
QObject::connect(layout.data(), &VPLayout::PieceZValueChanged, piece, &VPGraphicsPiece::PieceZValueChanged);
|
||||||
QObject::connect(layout.data(), &VPLayout::PieceSelectionChanged, m_rotationControls,
|
QObject::connect(layout.data(), &VPLayout::PieceSelectionChanged, m_rotationControls,
|
||||||
&VPGraphicsPieceControls::on_UpdateControls);
|
&VPGraphicsPieceControls::on_UpdateControls, Qt::UniqueConnection);
|
||||||
QObject::connect(layout.data(), &VPLayout::PiecePositionValidityChanged, piece, &VPGraphicsPiece::on_RefreshPiece);
|
QObject::connect(layout.data(), &VPLayout::PiecePositionValidityChanged, piece, &VPGraphicsPiece::on_RefreshPiece);
|
||||||
QObject::connect(piece, &VPGraphicsPiece::PieceTransformationChanged, m_rotationControls,
|
QObject::connect(piece, &VPGraphicsPiece::PieceTransformationChanged, m_rotationControls,
|
||||||
&VPGraphicsPieceControls::on_UpdateControls);
|
&VPGraphicsPieceControls::on_UpdateControls);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user