Add support Qt6
This commit is contained in:
parent
e60f1fdb97
commit
5ca81ad837
2 changed files with 9 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(rtptheme LANGUAGES CXX)
|
project(rtptheme LANGUAGES CXX)
|
||||||
|
|
||||||
|
@ -9,7 +9,10 @@ set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
if(NOT QT_DEFAULT_MAJOR_VERSION)
|
||||||
|
set(QT_DEFAULT_MAJOR_VERSION 5 CACHE STRING "Qt version to use (5 or 6), defaults to 5")
|
||||||
|
endif()
|
||||||
|
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets REQUIRED)
|
||||||
|
|
||||||
add_library(rtptheme SHARED
|
add_library(rtptheme SHARED
|
||||||
main.cpp
|
main.cpp
|
||||||
|
@ -18,8 +21,8 @@ add_library(rtptheme SHARED
|
||||||
rtptheme.json
|
rtptheme.json
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(rtptheme PRIVATE Qt5::Widgets)
|
target_link_libraries(rtptheme PRIVATE Qt::Widgets)
|
||||||
target_link_libraries(rtptheme PRIVATE Qt5::GuiPrivate)
|
target_link_libraries(rtptheme PRIVATE Qt::GuiPrivate)
|
||||||
|
|
||||||
target_compile_definitions(rtptheme PRIVATE RTPTHEME_LIBRARY)
|
target_compile_definitions(rtptheme PRIVATE RTPTHEME_LIBRARY)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef RTPTHEME_H
|
#ifndef RTPTHEME_H
|
||||||
#define RTPTHEME_H
|
#define RTPTHEME_H
|
||||||
|
|
||||||
#include <qpa/qplatformtheme.h>
|
#include <qpa/qplatformtheme.h>
|
||||||
|
@ -33,7 +33,7 @@ public:
|
||||||
|
|
||||||
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
|
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
|
||||||
QIcon fileIcon(const QFileInfo &fileInfo,
|
QIcon fileIcon(const QFileInfo &fileInfo,
|
||||||
QPlatformTheme::IconOptions iconOptions = nullptr) const override;
|
QPlatformTheme::IconOptions iconOptions = {}) const override;
|
||||||
|
|
||||||
QIconEngine *createIconEngine(const QString &iconName) const override;
|
QIconEngine *createIconEngine(const QString &iconName) const override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue