mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-14 13:46:39 +00:00
Fixes #63 Added support for setting the QtQuickControls2 style
This commit is contained in:
parent
9cafee9426
commit
886984a2a2
@ -11,6 +11,7 @@ find_package(Qt5Core)
|
|||||||
find_package(Qt5Qml)
|
find_package(Qt5Qml)
|
||||||
find_package(Qt5Gui)
|
find_package(Qt5Gui)
|
||||||
find_package(Qt5Quick)
|
find_package(Qt5Quick)
|
||||||
|
find_package(Qt5QuickControls2)
|
||||||
find_package(Qt5Widgets)
|
find_package(Qt5Widgets)
|
||||||
|
|
||||||
set(HEADERS_LIST
|
set(HEADERS_LIST
|
||||||
@ -52,12 +53,12 @@ add_library(${PROJECT_NAME} SHARED ${SRC_LIST} ${HEADERS_LIST})
|
|||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION "${major}.${minor}")
|
set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION "${major}.${minor}")
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION "${major}.${minor}.${patch}")
|
set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION "${major}.${minor}.${patch}")
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Qml Qt5::Quick)
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Qml Qt5::Quick Qt5::QuickControls2)
|
||||||
|
|
||||||
# Static version for testing
|
# Static version for testing
|
||||||
add_library("${PROJECT_NAME}Static" STATIC ${SRC_LIST} ${HEADERS_LIST})
|
add_library("${PROJECT_NAME}Static" STATIC ${SRC_LIST} ${HEADERS_LIST})
|
||||||
set_property(TARGET "${PROJECT_NAME}Static" PROPERTY CXX_STANDARD 11)
|
set_property(TARGET "${PROJECT_NAME}Static" PROPERTY CXX_STANDARD 11)
|
||||||
target_link_libraries("${PROJECT_NAME}Static" PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Qml Qt5::Quick)
|
target_link_libraries("${PROJECT_NAME}Static" PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Qml Qt5::Quick Qt5::QuickControls2)
|
||||||
|
|
||||||
# Install directive for header files
|
# Install directive for header files
|
||||||
install(FILES
|
install(FILES
|
||||||
|
@ -117,6 +117,18 @@ DOS_API void DOS_CALL dos_qqmlapplicationengine_delete(DosQQmlApplicationEngine
|
|||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
/// \defgroup QQuickStyle QQuickStyle
|
||||||
|
/// \brief Functions related to the QQuickStyle class
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
/// \brief Set the QtQuickControls2 style
|
||||||
|
DOS_API void DOS_CALL dos_qquickstyle_set_style(const char *style);
|
||||||
|
|
||||||
|
/// \brief Set the QtQuickControls2 fallback style
|
||||||
|
DOS_API void DOS_CALL dos_qquickstyle_set_fallback_style(const char *style);
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
|
|
||||||
/// \defgroup QQuickView QQuickView
|
/// \defgroup QQuickView QQuickView
|
||||||
/// \brief Functions related to the QQuickView class
|
/// \brief Functions related to the QQuickView class
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <QtQml/QQmlContext>
|
#include <QtQml/QQmlContext>
|
||||||
#include <QtQml/QQmlApplicationEngine>
|
#include <QtQml/QQmlApplicationEngine>
|
||||||
#include <QtQuick/QQuickView>
|
#include <QtQuick/QQuickView>
|
||||||
|
#include <QtQuickControls2/QQuickStyle>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
#include "DOtherSide/DOtherSideTypesCpp.h"
|
#include "DOtherSide/DOtherSideTypesCpp.h"
|
||||||
@ -901,3 +902,13 @@ int dos_qdeclarative_qmlregistersingletontype(const ::QmlRegisterType *cArgs)
|
|||||||
|
|
||||||
return DOS::dosQmlRegisterSingletonType(std::move(args));
|
return DOS::dosQmlRegisterSingletonType(std::move(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dos_qquickstyle_set_style(const char *style)
|
||||||
|
{
|
||||||
|
QQuickStyle::setStyle(QString::fromUtf8(style));
|
||||||
|
}
|
||||||
|
|
||||||
|
void dos_qquickstyle_set_fallback_style(const char *style)
|
||||||
|
{
|
||||||
|
QQuickStyle::setFallbackStyle(QString::fromUtf8(style));
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user