mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 10:34:14 +02:00
Merge pull request #582 from DieterMayerOSS/pr/font-legacy-format
Write font descriptions in a version-stable format (#553)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "../properties/elementdata.h"
|
||||
#include "../qetapp.h"
|
||||
#include "../qetversion.h"
|
||||
#include "../utils/qetutils.h"
|
||||
|
||||
#include <QAbstractTextDocumentLayout>
|
||||
#include <QDomElement>
|
||||
@@ -531,7 +532,7 @@ void ElementPictureFactory::parseText(const QDomElement &dom, QPainter &painter,
|
||||
font_ = QETApp::diagramTextsFont(dom.attribute("size").toDouble());
|
||||
}
|
||||
else if (dom.hasAttribute("font")) {
|
||||
font_.fromString(dom.attribute("font"));
|
||||
QETUtils::fontFromString(font_, dom.attribute("font"));
|
||||
}
|
||||
|
||||
QColor text_color(dom.attribute("color", "#000000"));
|
||||
|
||||
@@ -221,12 +221,12 @@ void AddTableDialog::saveConfig()
|
||||
header_object.insert("margins", QETUtils::marginsToString(this->headerMargins()));
|
||||
auto me = QMetaEnum::fromType<Qt::Alignment>();
|
||||
header_object.insert("alignment", me.valueToKey(int(this->headerAlignment())));
|
||||
header_object.insert("font", this->headerFont().toString());
|
||||
header_object.insert("font", QETUtils::fontToString(this->headerFont()));
|
||||
|
||||
QJsonObject table_object;
|
||||
table_object.insert("margins", QETUtils::marginsToString(this->tableMargins()));
|
||||
table_object.insert("alignment", me.valueToKey(int(this->tableAlignment())));
|
||||
table_object.insert("font", this->tableFont().toString());
|
||||
table_object.insert("font", QETUtils::fontToString(this->tableFont()));
|
||||
|
||||
QJsonObject config_object;
|
||||
config_object.insert("header", header_object);
|
||||
@@ -275,7 +275,7 @@ void AddTableDialog::loadConfig()
|
||||
default:
|
||||
ui->m_header_alignment_cb->setCurrentIndex(2);
|
||||
}
|
||||
m_header_font.fromString(header_object.value("font").toString());
|
||||
QETUtils::fontFromString(m_header_font, header_object.value("font").toString());
|
||||
ui->m_header_font_pb->setText(m_header_font.family());
|
||||
|
||||
//Table
|
||||
@@ -292,7 +292,7 @@ void AddTableDialog::loadConfig()
|
||||
default:
|
||||
ui->m_table_alignment_cb->setCurrentIndex(2);
|
||||
}
|
||||
m_table_font.fromString(table_object.value("font").toString());
|
||||
QETUtils::fontFromString(m_table_font, table_object.value("font").toString());
|
||||
ui->m_table_font_pb->setText(m_table_font.family());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user