summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp12
-rw-r--r--src/tools/uic/ui4.cpp18
-rw-r--r--src/tools/uic/ui4.h9
3 files changed, 38 insertions, 1 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index d791f9cb54..30cb9a4d58 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -235,6 +235,13 @@ int FontHandle::compare(const FontHandle &rhs) const
if (const int src = styleStrategy.compare(rhsStyleStrategy))
return src;
+ const QString hintingPreference = m_domFont->hasElementHintingPreference()
+ ? m_domFont->elementHintingPreference() : QString();
+ const QString rhsHintingPreference = rhs.m_domFont->hasElementHintingPreference()
+ ? rhs.m_domFont->elementHintingPreference() : QString();
+ if (const int src = hintingPreference.compare(rhsHintingPreference))
+ return src;
+
return 0;
}
@@ -1657,6 +1664,11 @@ QString WriteInitialization::writeFontProperties(const DomFont *f)
m_output << m_indent << fontName << ".setStyleStrategy(QFont"
<< language::qualifier << f->elementStyleStrategy() << ')' << language::eol;
}
+ if (f->hasElementHintingPreference()) {
+ m_output << m_indent << fontName << ".setHintingPreference(QFont"
+ << language::qualifier << f->elementHintingPreference() << ')' << language::eol;
+ }
+
return fontName;
}
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp
index 42ee4fbefa..5c9240a5c9 100644
--- a/src/tools/uic/ui4.cpp
+++ b/src/tools/uic/ui4.cpp
@@ -3121,6 +3121,10 @@ void DomFont::read(QXmlStreamReader &reader)
setElementKerning(reader.readElementText() == u"true"_s);
continue;
}
+ if (!tag.compare(u"hintingpreference"_s, Qt::CaseInsensitive)) {
+ setElementHintingPreference(reader.readElementText());
+ continue;
+ }
reader.raiseError("Unexpected element "_L1 + tag);
}
break;
@@ -3166,6 +3170,9 @@ void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const
if (m_children & Kerning)
writer.writeTextElement(u"kerning"_s, (m_kerning ? u"true"_s : u"false"_s));
+ if (m_children & HintingPreference)
+ writer.writeTextElement(u"hintingpreference"_s, m_hintingPreference);
+
writer.writeEndElement();
}
@@ -3229,6 +3236,12 @@ void DomFont::setElementKerning(bool a)
m_kerning = a;
}
+void DomFont::setElementHintingPreference(const QString &a)
+{
+ m_children |= HintingPreference;
+ m_hintingPreference = a;
+}
+
void DomFont::clearElementFamily()
{
m_children &= ~Family;
@@ -3279,6 +3292,11 @@ void DomFont::clearElementKerning()
m_children &= ~Kerning;
}
+void DomFont::clearElementHintingPreference()
+{
+ m_children &= ~HintingPreference;
+}
+
DomPoint::~DomPoint() = default;
void DomPoint::read(QXmlStreamReader &reader)
diff --git a/src/tools/uic/ui4.h b/src/tools/uic/ui4.h
index 577baa3766..7244d1d59b 100644
--- a/src/tools/uic/ui4.h
+++ b/src/tools/uic/ui4.h
@@ -1645,6 +1645,11 @@ public:
inline bool hasElementKerning() const { return m_children & Kerning; }
void clearElementKerning();
+ inline QString elementHintingPreference() const { return m_hintingPreference; }
+ void setElementHintingPreference(const QString &a);
+ inline bool hasElementHintingPreference() const { return m_children & HintingPreference; }
+ void clearElementHintingPreference();
+
private:
// child element data
@@ -1659,6 +1664,7 @@ private:
bool m_antialiasing = false;
QString m_styleStrategy;
bool m_kerning = false;
+ QString m_hintingPreference;
enum Child {
Family = 1,
@@ -1670,7 +1676,8 @@ private:
StrikeOut = 64,
Antialiasing = 128,
StyleStrategy = 256,
- Kerning = 512
+ Kerning = 512,
+ HintingPreference = 1024
};
};