qt5/6: 处理在 Windows 中的 Qt6 转化处理

This commit is contained in:
zinface 2023-02-28 16:19:02 +08:00
parent 351a95b288
commit cc4ec3da28
3 changed files with 14 additions and 0 deletions

View File

@ -53,9 +53,11 @@
#include <QDateTime>
#include <QShortcut>
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
#include <QXmlQuery>
#include <QXmlFormatter>
#endif
#endif
#include <QBuffer>
#include <QXmlStreamReader>
#include <QJsonObject>
@ -7593,7 +7595,11 @@ bool CCNotePad::nativeOpenfile(QString openFilePath)
this->activateWindow();
return true;
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
bool CCNotePad::nativeEvent(const QByteArray & eventType, void * message, long * result)
#else
bool CCNotePad::nativeEvent(const QByteArray & eventType, void * message, qintptr * result)
#endif
{
MSG *param = static_cast<MSG *>(message);

View File

@ -196,7 +196,11 @@ protected:
void dropEvent(QDropEvent* e) override;
bool eventFilter(QObject *watched, QEvent *event)override;
#ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
#else
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
#endif
bool nativeOpenfile(QString openFilePath);
#endif
#ifdef uos

View File

@ -103,7 +103,11 @@ bool UserLexDef::writeUserSettings(QString langTagName)
qs.setValue("mz", langTagName);
qs.setValue("mother", m_motherLang);
qs.setValue("ext", m_extTypes);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
qs.setValue("keyword", m_keyword.data());
#else
qs.setValue("keyword", QString(m_keyword.data()));
#endif
return true;
}