[TD]fix default line width on empty config

This commit is contained in:
wandererfan
2024-07-04 19:35:44 -04:00
committed by WandererFan
parent d98aa70d0e
commit 7d8df6cd55
3 changed files with 27 additions and 16 deletions

View File

@@ -68,6 +68,7 @@
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/LineGenerator.h>
#include <Mod/TechDraw/App/LineGroup.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "DlgPageChooser.h"
@@ -190,6 +191,23 @@ void DrawGuiUtil::loadLineStyleChoices(QComboBox* combo, LineGenerator* generato
}
}
void DrawGuiUtil::loadLineGroupChoices(QComboBox* combo)
{
combo->clear();
std::string lgFileName = Preferences::lineGroupFile();
std::string lgRecord = LineGroup::getGroupNamesFromFile(lgFileName);
// split collected groups
std::stringstream ss(lgRecord);
std::vector<QString> lgNames;
while (std::getline(ss, lgRecord, ',')) {
lgNames.push_back(Base::Tools::fromStdString(lgRecord));
}
// fill the combobox with the found names
for (auto& name : lgNames) {
combo->addItem(name);
}
}
//! make an icon that shows a sample of lineNumber in the current line standard
QIcon DrawGuiUtil::iconForLine(size_t lineNumber,