mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Don't show invalid submodels in properties parts list. Fixes #787.
This commit is contained in:
parent
cdc730b5f7
commit
7716ffb6e6
1 changed files with 7 additions and 1 deletions
|
@ -517,9 +517,15 @@ QWidget *lcQPropertiesTree::createEditor(QWidget *parent, QTreeWidgetItem *item)
|
||||||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||||
std::vector<PieceInfo*> SortedPieces;
|
std::vector<PieceInfo*> SortedPieces;
|
||||||
SortedPieces.reserve(Library->mPieces.size());
|
SortedPieces.reserve(Library->mPieces.size());
|
||||||
|
const lcModel* ActiveModel = gMainWindow->GetActiveModel();
|
||||||
|
|
||||||
for (const auto& PartIt : Library->mPieces)
|
for (const auto& PartIt : Library->mPieces)
|
||||||
|
{
|
||||||
|
PieceInfo* Info = PartIt.second;
|
||||||
|
|
||||||
|
if (!Info->IsModel() || !Info->GetModel()->IncludesModel(ActiveModel))
|
||||||
SortedPieces.push_back(PartIt.second);
|
SortedPieces.push_back(PartIt.second);
|
||||||
|
}
|
||||||
|
|
||||||
auto PieceCompare = [](PieceInfo* Info1, PieceInfo* Info2)
|
auto PieceCompare = [](PieceInfo* Info1, PieceInfo* Info2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue