From cc4ec3da2898042ef9786b9ba0aa502ca1c87096 Mon Sep 17 00:00:00 2001 From: zinface Date: Tue, 28 Feb 2023 16:19:02 +0800 Subject: [PATCH] =?UTF-8?q?qt5/6:=20=E5=A4=84=E7=90=86=E5=9C=A8=20Windows?= =?UTF-8?q?=20=E4=B8=AD=E7=9A=84=20Qt6=20=E8=BD=AC=E5=8C=96=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cceditor/ccnotepad.cpp | 6 ++++++ src/cceditor/ccnotepad.h | 4 ++++ src/userlexdef.cpp | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/src/cceditor/ccnotepad.cpp b/src/cceditor/ccnotepad.cpp index 570ef8a..c8e9772 100755 --- a/src/cceditor/ccnotepad.cpp +++ b/src/cceditor/ccnotepad.cpp @@ -53,9 +53,11 @@ #include #include #ifdef Q_OS_WIN +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include #include #endif +#endif #include #include #include @@ -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(message); diff --git a/src/cceditor/ccnotepad.h b/src/cceditor/ccnotepad.h index 84ab6e6..0b85943 100755 --- a/src/cceditor/ccnotepad.h +++ b/src/cceditor/ccnotepad.h @@ -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 diff --git a/src/userlexdef.cpp b/src/userlexdef.cpp index 78ba379..b10a744 100755 --- a/src/userlexdef.cpp +++ b/src/userlexdef.cpp @@ -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; }