[PartDesign]: Sort sketches in Attach sketch tool alphabetically

The order of sketches in sketch attaching tool is now determined
by the order in which they were added to document.
Sorting them alphabetically makes IMHO much easier to find a sketch
by user, compared to current state, especially in large and complex
projects with lot of sketches. Of cuser thix expects the user
use sensible names for the sketches.
This commit is contained in:
Jiří Pinkava
2024-09-13 17:40:04 +02:00
committed by Chris Hennes
parent a90bbf27cc
commit e06ce1189c

View File

@@ -605,6 +605,9 @@ void CmdSketcherMapSketch::activated(int iMsg)
return;
}
std::sort(sketches.begin(), sketches.end(), [](const auto &a, const auto &b) {
return QString::fromUtf8(a->Label.getValue()) < QString::fromUtf8(b->Label.getValue());
});
bool ok;
QStringList items;