Rename library for QQuickImageProvider to `qtquickforkawesome`
It makes sense to have *one* extra library for all Qt Quick related features so the library should just be called `qtquickforkawesome` instead of using a name specific to `QQuickImageProvider`.
This commit is contained in:
parent
8d872ca461
commit
009c722c89
|
@ -38,7 +38,7 @@ add_subdirectory(${META_PROJECT_NAME})
|
||||||
set(${PACKAGE_NAMESPACE_PREFIX}${META_PROJECT_NAME}${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/${META_PROJECT_NAME}")
|
set(${PACKAGE_NAMESPACE_PREFIX}${META_PROJECT_NAME}${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/${META_PROJECT_NAME}")
|
||||||
add_subdirectory(iconengineplugin)
|
add_subdirectory(iconengineplugin)
|
||||||
|
|
||||||
option(ENABLE_QT_QUICK_IMAGE_PROVIDER "enables building the QQuickImageProvider" OFF)
|
option(ENABLE_QT_QUICK_LIBRARY "enables building the library for Qt Quick integration" OFF)
|
||||||
if (ENABLE_QT_QUICK_IMAGE_PROVIDER)
|
if (ENABLE_QT_QUICK_LIBRARY)
|
||||||
add_subdirectory(${META_PROJECT_NAME}quickimageprovider)
|
add_subdirectory(qtquickforkawesome)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -79,13 +79,13 @@ to one of your source files.
|
||||||
|
|
||||||
### QQuickImageProvider
|
### QQuickImageProvider
|
||||||
A `QQuickImageProvider` is provided as well in form of the additional library
|
A `QQuickImageProvider` is provided as well in form of the additional library
|
||||||
`qtforkawesomequickimageprovider` which can be enabled by adding
|
`qtquickforkawesome` which can be enabled by adding
|
||||||
`-DENABLE_QT_QUICK_IMAGE_PROVIDER:BOOL=ON` to the CMake arguments.
|
`-DENABLE_QT_QUICK_LIBRARY:BOOL=ON` to the CMake arguments.
|
||||||
|
|
||||||
Then just include the header:
|
Then just include the header:
|
||||||
|
|
||||||
```
|
```
|
||||||
#include <qtforkawesomequickimageprovider/provider.h>
|
#include <qtquickforkawesome/imageprovider.h>
|
||||||
```
|
```
|
||||||
|
|
||||||
Create an instance and add it to your `QQmlEngine`:
|
Create an instance and add it to your `QQmlEngine`:
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Created via CMake from template global.h.in
|
|
||||||
// WARNING! Any changes to this file will be overwritten by the next CMake run!
|
|
||||||
|
|
||||||
#ifndef QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_GLOBAL
|
|
||||||
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_GLOBAL
|
|
||||||
|
|
||||||
#include <c++utilities/application/global.h>
|
|
||||||
|
|
||||||
#ifdef QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_STATIC
|
|
||||||
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_EXPORT
|
|
||||||
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_IMPORT
|
|
||||||
#else
|
|
||||||
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT
|
|
||||||
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \def QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_EXPORT
|
|
||||||
* \brief Marks the symbol to be exported by the qtforkawesomequickimageprovider library.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \def QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_IMPORT
|
|
||||||
* \brief Marks the symbol to be imported from the qtforkawesomequickimageprovider library.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif // QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_GLOBAL
|
|
|
@ -1,12 +1,12 @@
|
||||||
# additional meta data
|
# additional meta data
|
||||||
set(META_PROJECT_NAME qtforkawesomequickimageprovider)
|
set(META_PROJECT_NAME qtquickforkawesome)
|
||||||
set(META_PROJECT_VARNAME QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER)
|
set(META_PROJECT_VARNAME QT_QUICK_FORK_AWESOME)
|
||||||
set(META_APP_NAME "QQuickImageProvider for ForkAwesome")
|
set(META_APP_NAME "QQuickImageProvider for ForkAwesome")
|
||||||
set(META_APP_DESCRIPTION "QQuickImageProvider for ForkAwesome")
|
set(META_APP_DESCRIPTION "QQuickImageProvider for ForkAwesome")
|
||||||
|
|
||||||
# add project files
|
# add project files
|
||||||
set(HEADER_FILES provider.h)
|
set(HEADER_FILES imageprovider.h)
|
||||||
set(SRC_FILES provider.cpp)
|
set(SRC_FILES imageprovider.cpp)
|
||||||
set(DOC_FILES ../README.md)
|
set(DOC_FILES ../README.md)
|
||||||
|
|
||||||
# use headers and CMake modules from c++utilities and qtutilities
|
# use headers and CMake modules from c++utilities and qtutilities
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Created via CMake from template global.h.in
|
||||||
|
// WARNING! Any changes to this file will be overwritten by the next CMake run!
|
||||||
|
|
||||||
|
#ifndef QT_QUICK_FORK_AWESOME_GLOBAL
|
||||||
|
#define QT_QUICK_FORK_AWESOME_GLOBAL
|
||||||
|
|
||||||
|
#include <c++utilities/application/global.h>
|
||||||
|
|
||||||
|
#ifdef QT_QUICK_FORK_AWESOME_STATIC
|
||||||
|
#define QT_QUICK_FORK_AWESOME_EXPORT
|
||||||
|
#define QT_QUICK_FORK_AWESOME_IMPORT
|
||||||
|
#else
|
||||||
|
#define QT_QUICK_FORK_AWESOME_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT
|
||||||
|
#define QT_QUICK_FORK_AWESOME_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \def QT_QUICK_FORK_AWESOME_EXPORT
|
||||||
|
* \brief Marks the symbol to be exported by the qtquickforkawesome library.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \def QT_QUICK_FORK_AWESOME_IMPORT
|
||||||
|
* \brief Marks the symbol to be imported from the qtquickforkawesome library.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // QT_QUICK_FORK_AWESOME_GLOBAL
|
|
@ -1,4 +1,4 @@
|
||||||
#include "./provider.h"
|
#include "./imageprovider.h"
|
||||||
|
|
||||||
#include <qtforkawesome/renderer.h>
|
#include <qtforkawesome/renderer.h>
|
||||||
#include <qtforkawesome/utils.h>
|
#include <qtforkawesome/utils.h>
|
||||||
|
@ -28,7 +28,7 @@ QPixmap QuickImageProvider::requestPixmap(const QString &id, QSize *size, const
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
#endif
|
#endif
|
||||||
const auto parts = id.splitRef(QChar(':'));
|
const auto parts = QtUtilities::splitRef(id, QChar(':'));
|
||||||
if (parts.empty()) {
|
if (parts.empty()) {
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@ namespace QtForkAwesome {
|
||||||
|
|
||||||
class Renderer;
|
class Renderer;
|
||||||
|
|
||||||
class QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_EXPORT QuickImageProvider : public QQuickImageProvider {
|
class QT_QUICK_FORK_AWESOME_EXPORT QuickImageProvider : public QQuickImageProvider {
|
||||||
public:
|
public:
|
||||||
QuickImageProvider(Renderer &renderer, const QColor &defaultColor = QColor(), const QSize &defaultSize = QSize(64, 64),
|
QuickImageProvider(Renderer &renderer, const QColor &defaultColor = QColor(), const QSize &defaultSize = QSize(64, 64),
|
||||||
QQuickImageProvider::ImageType type = QQuickImageProvider::Pixmap);
|
QQuickImageProvider::ImageType type = QQuickImageProvider::Pixmap);
|
Loading…
Reference in New Issue