fix: 处理 Markdown 预览在 Qt5.14 版本以下的编译错误

This commit is contained in:
zinface 2023-05-25 15:57:52 +08:00
parent fd1b4595fd
commit a0bf03b399
1 changed files with 10 additions and 0 deletions

View File

@ -14,5 +14,15 @@ MarkdownView::~MarkdownView()
void MarkdownView::viewMarkdown(QString& text) void MarkdownView::viewMarkdown(QString& text)
{ {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QString tips = QString(
"NOTE: Your Qt version is lower than 5.14, so you can't preview Markdown for the time being."
"\n"
"\n"
"%1").arg(text);
ui.textEdit->setPlainText(tips);
#else
ui.textEdit->setMarkdown(text); ui.textEdit->setMarkdown(text);
#endif
} }