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:
Martchus 2021-10-15 19:58:06 +02:00
parent 8d872ca461
commit 009c722c89
7 changed files with 40 additions and 40 deletions

View File

@ -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}")
add_subdirectory(iconengineplugin)
option(ENABLE_QT_QUICK_IMAGE_PROVIDER "enables building the QQuickImageProvider" OFF)
if (ENABLE_QT_QUICK_IMAGE_PROVIDER)
add_subdirectory(${META_PROJECT_NAME}quickimageprovider)
option(ENABLE_QT_QUICK_LIBRARY "enables building the library for Qt Quick integration" OFF)
if (ENABLE_QT_QUICK_LIBRARY)
add_subdirectory(qtquickforkawesome)
endif ()

View File

@ -79,13 +79,13 @@ to one of your source files.
### QQuickImageProvider
A `QQuickImageProvider` is provided as well in form of the additional library
`qtforkawesomequickimageprovider` which can be enabled by adding
`-DENABLE_QT_QUICK_IMAGE_PROVIDER:BOOL=ON` to the CMake arguments.
`qtquickforkawesome` which can be enabled by adding
`-DENABLE_QT_QUICK_LIBRARY:BOOL=ON` to the CMake arguments.
Then just include the header:
```
#include <qtforkawesomequickimageprovider/provider.h>
#include <qtquickforkawesome/imageprovider.h>
```
Create an instance and add it to your `QQmlEngine`:

View File

@ -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

View File

@ -1,12 +1,12 @@
# additional meta data
set(META_PROJECT_NAME qtforkawesomequickimageprovider)
set(META_PROJECT_VARNAME QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER)
set(META_PROJECT_NAME qtquickforkawesome)
set(META_PROJECT_VARNAME QT_QUICK_FORK_AWESOME)
set(META_APP_NAME "QQuickImageProvider for ForkAwesome")
set(META_APP_DESCRIPTION "QQuickImageProvider for ForkAwesome")
# add project files
set(HEADER_FILES provider.h)
set(SRC_FILES provider.cpp)
set(HEADER_FILES imageprovider.h)
set(SRC_FILES imageprovider.cpp)
set(DOC_FILES ../README.md)
# use headers and CMake modules from c++utilities and qtutilities

View File

@ -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

View File

@ -1,4 +1,4 @@
#include "./provider.h"
#include "./imageprovider.h"
#include <qtforkawesome/renderer.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)
Q_UNUSED(options)
#endif
const auto parts = id.splitRef(QChar(':'));
const auto parts = QtUtilities::splitRef(id, QChar(':'));
if (parts.empty()) {
return QPixmap();
}

View File

@ -14,7 +14,7 @@ namespace QtForkAwesome {
class Renderer;
class QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER_EXPORT QuickImageProvider : public QQuickImageProvider {
class QT_QUICK_FORK_AWESOME_EXPORT QuickImageProvider : public QQuickImageProvider {
public:
QuickImageProvider(Renderer &renderer, const QColor &defaultColor = QColor(), const QSize &defaultSize = QSize(64, 64),
QQuickImageProvider::ImageType type = QQuickImageProvider::Pixmap);