WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
inishell
Commits
eab72a11
Commit
eab72a11
authored
Mar 09, 2022
by
Mathias Bavay
Browse files
Getting closer to Qt6 compatibility
parent
2ea828ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
eab72a11
...
...
@@ -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
)
...
...
src/main/common.cc
View file @
eab72a11
...
...
@@ -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
...
...
src/main/common.h
View file @
eab72a11
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment