WSL/SLF GitLab Repository

Commit eab72a11 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Getting closer to Qt6 compatibility

parent 2ea828ef
......@@ -23,11 +23,11 @@ IF(CMAKE_VERSION VERSION_LESS "3.7.0")
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
ENDIF()
#in order to support both Qt5 and QT6 (knowing that we require XmlPatterns and this module is already deprecated since qt5.13 and gone in qt6)
#in order to support both Qt5 and QT6
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Xml XmlPatterns REQUIRED)
SET(QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::XmlPatterns)
MARK_AS_ADVANCED(FORCE Qt${QT_VERSION_MAJOR}Core_DIR Qt${QT_VERSION_MAJOR}Gui_DIR Qt${QT_VERSION_MAJOR}Network_DIR Qt${QT_VERSION_MAJOR}Widgets_DIR Qt${QT_VERSION_MAJOR}XmlPatterns_DIR Qt${QT_VERSION_MAJOR}Xml_DIR Qt${QT_VERSION_MAJOR}_DIR)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Xml Network REQUIRED)
SET(QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::Network)
MARK_AS_ADVANCED(FORCE Qt${QT_VERSION_MAJOR}Core_DIR Qt${QT_VERSION_MAJOR}Gui_DIR Qt${QT_VERSION_MAJOR}Network_DIR Qt${QT_VERSION_MAJOR}Widgets_DIR Qt${QT_VERSION_MAJOR}Xml_DIR Qt${QT_VERSION_MAJOR}_DIR)
#finally, SET compile flags
SET(CMAKE_CXX_FLAGS "${ARCH} ${EXTRA}" CACHE STRING "" FORCE)
......
......@@ -50,24 +50,6 @@ QString color(const QString &text, const QString &color)
} //namespace html
/**
* @brief Retrieve the message of an event that wants to communicate.
* @details This class is used for example by the XML schema validation.
* @param[in] type Type of the message (unused).
* @param[in] description A text description of what has happened.
* @param[in] identifier Identifier for the message (unused).
* @param[in] location The location something has happened at (e. g. line number for text errors).
*/
void MessageHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier,
const QSourceLocation &location)
{
Q_UNUSED(type) //turn off compiler warnings
Q_UNUSED(identifier)
description_ = description;
location_ = location;
}
QIcon getIcon(const QString& icon_name)
{
const bool use_darkmode = colors::useDarkTheme(); //decide whether to use dark mode
......
......@@ -34,7 +34,6 @@
#include <QString>
#include <QStringList>
#include <QtXml>
#include <QtXmlPatterns/QAbstractMessageHandler>
#include <QtGlobal>
namespace html {
......@@ -56,27 +55,6 @@ struct CaseInsensitiveCompare {
}
};
/**
* @class MessageHandler
* @brief Message handler to conveniently retrieve Qt internal messages.
* @details This class is used for example to get XML schema validation errors.
*/
class MessageHandler : public QAbstractMessageHandler {
public:
MessageHandler() : QAbstractMessageHandler(nullptr), description_(), location_() {}
QString status() const { return description_; }
int line() const { return static_cast<int>(location_.line()); }
int column() const { return static_cast<int>(location_.column()); }
protected:
void handleMessage(QtMsgType type, const QString &description,
const QUrl &identifier, const QSourceLocation &location) override;
private:
QString description_;
QSourceLocation location_;
};
/**
* @brief Check if an XML node has a certain INI section associated with i.
* @param[in] section Check if this section is present.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment