From 97709bff6a286a80e59431f65783921313a434ee Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Fri, 7 Aug 2026 11:42:20 +0200 Subject: [PATCH] Save the default cross-reference properties to QSettings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NewDiagramPage::applyConf() writes every other default to QSettings — border, title block, conductors, folio reports and the guides — but the cross-reference branch only fetched the properties into a local hash and then dropped it on the floor. hash_xrp was never used. The result: changing the cross-reference defaults under Settings > New project has no effect. Nothing is written, no defaultxref* key ever appears in the configuration file, and XRefProperties::defaultProperties() keeps handing out the hardcoded fallbacks for every new project. Write each of the four types (coil, protection, commutator, plc) with the "diagrameditor/defaultxref" + key prefix that defaultProperties() already reads back. --- sources/ui/configpage/configpages.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/ui/configpage/configpages.cpp b/sources/ui/configpage/configpages.cpp index 1a01a343e..26711a18c 100644 --- a/sources/ui/configpage/configpages.cpp +++ b/sources/ui/configpage/configpages.cpp @@ -214,7 +214,11 @@ void NewDiagramPage::applyConf() rpw->toSettings(settings, "diagrameditor/defaultreport"); // default xref properties - QHash hash_xrp = xrefpw -> properties(); + const QHash hash_xrp = xrefpw->properties(); + for (auto it = hash_xrp.constBegin() ; it != hash_xrp.constEnd() ; ++it) { + it.value().toSettings(settings, + QStringLiteral("diagrameditor/defaultxref") % it.key()); + } // Global in QSettings speichern QList current_guides = m_gpw->guides();