Terminal strip: save the layout (font, cell sizes...) in the project

The default terminal strip layout was rebuilt at every project load,
so the font size set in the layout editor was reset to 15 px.
Add TerminalStripLayoutPattern::toXml/fromXml and
TerminalStripLayoutsHandler::toXml/fromXml, write a
<terminal_strip_layout> element in QETProject::toXml() and read it
before the diagrams are loaded. Projects without it keep the defaults.
This commit is contained in:
Laurent Trinques
2026-10-10 09:49:42 +02:00
parent da31e93b1f
commit daa648099b
5 changed files with 216 additions and 0 deletions
+6
View File
@@ -1587,6 +1587,8 @@ QDomDocument QETProject::toXml()
//Write terminal strip to xml
if (m_terminal_strip_vector.count())
{
m_project_properties_handler.terminalStripLayoutHandler().toXml(project_root);
auto xml_strip = xml_doc.createElement(QStringLiteral("terminal_strips"));
for (auto &strip : m_terminal_strip_vector) {
xml_strip.appendChild(strip->toXml(xml_doc));
@@ -2092,6 +2094,10 @@ void QETProject::readProjectXml(QDomDocument &xml_project)
readElementsCollectionXml(xml_project);
const qint64 elements_ms = phase_timer.restart();
//Load the layout of the terminal strip (font, size of cells...),
//before the diagrams because the terminal strip items use it
m_project_properties_handler.terminalStripLayoutHandler().fromXml(xml_project.documentElement());
//Load the diagrams
readDiagramsXml(xml_project);
const qint64 diagrams_ms = phase_timer.restart();