From 34103b44673065457f77242e674ae7d28bda831d Mon Sep 17 00:00:00 2001
From: yboucher <yann.boucher@etu.utc.fr>
Date: Thu, 10 Jun 2021 21:33:09 +0200
Subject: [PATCH] Better checks against Qt's version and improved support for
 copy data files to the executable directory

---
 src/interface.cpp        |  2 +-
 src/src.pro              | 12 +++++++-----
 src/uibuildervisitor.cpp |  5 +++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/interface.cpp b/src/interface.cpp
index b9b1047..a315e9e 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -21,7 +21,7 @@
 #include <QTimer>
 #include <QElapsedTimer>
 
-#if QT_VERSION >= 0x050000 && QT_VERSION < 0x060000
+#if QT_VERSION_MAJOR == 5
 #define BAD_APPLE_AUDIO
 #endif
 
diff --git a/src/src.pro b/src/src.pro
index 97ec7d3..85e2b3d 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -108,8 +108,10 @@ CONFIG(debug, debug|release) {
     DEBUG_OR_RELEASE = release
 }
 
-# On copie les fichiers de pattern et de modèle vers le dossier d'exécution
-#message($$system($$QMAKE_COPY_DIR $$shell_quote($$PWD/../patterns) $$shell_quote($$OUT_PWD/$$DEBUG_OR_RELEASE/patterns)))
-#message($$system($$QMAKE_COPY_DIR $$shell_quote($$PWD/../patterns) $$shell_quote($$OUT_PWD/patterns)))
-#message($$system($$QMAKE_COPY_DIR $$shell_quote($$PWD/../models) $$shell_quote($$OUT_PWD/$$DEBUG_OR_RELEASE/models)))
-#message($$system($$QMAKE_COPY_DIR $$shell_quote($$PWD/../models) $$shell_quote($$OUT_PWD/models)))
+# On copie les fichiers de pattern, de modèle, etc... vers le dossier d'exécution
+# https://evileg.com/en/post/476/
+CONFIG += file_copies
+COPIES += data
+
+data.files = $$files($$PWD/../patterns) $$files($$PWD/../models) $$files($$PWD/../configurations) $$files($$PWD/../extras)
+data.path = $$OUT_PWD
diff --git a/src/uibuildervisitor.cpp b/src/uibuildervisitor.cpp
index f391fca..ebf61e4 100644
--- a/src/uibuildervisitor.cpp
+++ b/src/uibuildervisitor.cpp
@@ -1,7 +1,6 @@
 #include "propertyvisitors.hpp"
 
-
-
+#include <QtGlobal>
 #include <QGroupBox>
 #include <QPushButton>
 #include <QDebug>
@@ -140,7 +139,9 @@ void UIBuilderVisitor::visit(HelpProperty& prop)
                      [msg]() {
         QMessageBox* box = new QMessageBox(QMessageBox::NoIcon, "Help", msg,
                         QMessageBox::Ok);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
         box->setTextFormat(Qt::MarkdownText);
+#endif
         box->setTextInteractionFlags(Qt::TextBrowserInteraction);
         box->show();
     });
-- 
GitLab