Don't show invalid submodels in properties parts list. Fixes #787.

This commit is contained in:
Leonardo Zide 2022-04-21 12:33:50 -03:00
parent cdc730b5f7
commit 7716ffb6e6

View file

@ -517,9 +517,15 @@ QWidget *lcQPropertiesTree::createEditor(QWidget *parent, QTreeWidgetItem *item)
lcPiecesLibrary* Library = lcGetPiecesLibrary();
std::vector<PieceInfo*> SortedPieces;
SortedPieces.reserve(Library->mPieces.size());
const lcModel* ActiveModel = gMainWindow->GetActiveModel();
for (const auto& PartIt : Library->mPieces)
{
PieceInfo* Info = PartIt.second;
if (!Info->IsModel() || !Info->GetModel()->IncludesModel(ActiveModel))
SortedPieces.push_back(PartIt.second);
}
auto PieceCompare = [](PieceInfo* Info1, PieceInfo* Info2)
{