summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat_p.h
diff options
context:
space:
mode:
authorJordi Pujol Foyo <jordi@vikingsoftware.com>2020-05-08 15:23:21 +0200
committerJordi Pujol Foyo <jordi@vikingsoftware.com>2020-08-26 16:40:10 +0200
commit560117351cd1e032c30e2691a2e933e3ebb84edd (patch)
tree9134bc2119f5ae0089642aeff842a4c67894a2bd /src/gui/text/qtextformat_p.h
parentcba2d0443411b937586f259059e7f14c1cf5b512 (diff)
Allow arbitrary baseline shift in QTextCharacterFormat
Added 6 new methods in QTextFormat and QTextDocument to allow setting/getting specific % positioning for baseline and super/ subscript. Modified QTextLayout to honor those new settings. [ChangeLog][QtGui][QTextLayout,QTextFormat,QTextDocument] Allow text layout modification based on baseline offset and super/subscript % height positioning Fixes: QTBUG-18260 Change-Id: I0796f18224aac8df6baf8359c35022fd98fe64ef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qtextformat_p.h')
-rw-r--r--src/gui/text/qtextformat_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/text/qtextformat_p.h b/src/gui/text/qtextformat_p.h
index 862ef18e65..13815d06b3 100644
--- a/src/gui/text/qtextformat_p.h
+++ b/src/gui/text/qtextformat_p.h
@@ -101,8 +101,15 @@ public:
inline QFont defaultFont() const { return defaultFnt; }
void setDefaultFont(const QFont &f);
+ inline void setSuperScriptBaseline(qreal baseline) { defaultFormat.setSuperScriptBaseline(baseline); }
+ inline void setSubScriptBaseline(qreal baseline) { defaultFormat.setSubScriptBaseline(baseline); }
+ inline void setBaselineOffset(qreal baseline) { defaultFormat.setBaselineOffset(baseline); }
+
+ inline QTextCharFormat defaultTextFormat() const { return defaultFormat; }
+
private:
QFont defaultFnt;
+ QTextCharFormat defaultFormat;
Q_DISABLE_COPY_MOVE(QTextFormatCollection)
};