From e1e60d2f64eff1e3326252dceb1e0f4a046280b4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 15 Jan 2023 13:38:36 +0000 Subject: [PATCH] qt 5.12 compatibility --- libs/qsynedit/qsynedit/exporter/rtfexporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/qsynedit/qsynedit/exporter/rtfexporter.cpp b/libs/qsynedit/qsynedit/exporter/rtfexporter.cpp index 91aa1bc0..0ef0daa4 100644 --- a/libs/qsynedit/qsynedit/exporter/rtfexporter.cpp +++ b/libs/qsynedit/qsynedit/exporter/rtfexporter.cpp @@ -145,7 +145,11 @@ QString RTFExporter::getFormatName() QString RTFExporter::getHeader() { QFontMetrics fm(mFont); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) int tabWidth = mTabSize * fm.horizontalAdvance("M")*72*20/fm.fontDpi(); +#else + int tabWidth = mTabSize * fm.horizontalAdvance("M")*72*20/96; +#endif QString result = QString("{\\rtf1\\ansi\\deff0\\deftab%1").arg(tabWidth) + getFontTable(); // all the colors