[LyX/master] Cmake build with qt6 on MAC

Kornel Benko kornel at lyx.org
Fri Mar 26 12:05:56 UTC 2021


commit a9b0f5faae83d5a44b044bd71d400d03fbe96257
Author: Kornel Benko <kornel at lyx.org>
Date:   Fri Mar 26 13:09:32 2021 +0100

    Cmake build with qt6 on MAC
    
    Patch from P. De Visschere
    Citing:
    I also must exclude the QMacPasteboardMimeGraphics class in
    GuiApplication.cpp since QMacPasteboard is not available anymore with qt6.
    
    and add an #include <QStandardPaths> in support/Package.cpp (I suppose
    this will pose no problem for qt5 but have not checked it, it's only
    needed with USE_MACOSX_PACKAGING)
---
 src/frontends/qt/GuiApplication.cpp |    6 +++---
 src/support/Package.cpp             |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index e6964ed..aaff335 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -153,7 +153,7 @@
 #endif
 #endif
 
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) && (QT_VERSION < 0x060000)
 #include <QMacPasteboardMime>
 #endif // Q_OS_MAC
 
@@ -752,7 +752,7 @@ public:
 //
 ////////////////////////////////////////////////////////////////////////
 
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) && (QT_VERSION < 0x060000)
 // QMacPasteboardMimeGraphics can only be compiled on Mac.
 
 class QMacPasteboardMimeGraphics : public QMacPasteboardMime
@@ -1048,7 +1048,7 @@ struct GuiApplication::Private
 	Qt::ApplicationState last_state_;
 #endif
 
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) && (QT_VERSION < 0x060000)
 	/// Linkback mime handler for MacOSX.
 	QMacPasteboardMimeGraphics mac_pasteboard_mime_;
 #endif
diff --git a/src/support/Package.cpp b/src/support/Package.cpp
index a349a5e..a779544 100644
--- a/src/support/Package.cpp
+++ b/src/support/Package.cpp
@@ -43,6 +43,7 @@
 # include "support/qstring_helpers.h"
 # include <QDir>
 # include <QDesktopServices>
+# include <QStandardPaths>
 #endif
 
 using namespace std;


More information about the lyx-cvs mailing list