diff --git a/src/QmlStyleUrlInterceptor.h b/src/QmlStyleUrlInterceptor.h index e5ba5e8..84e06ad 100644 --- a/src/QmlStyleUrlInterceptor.h +++ b/src/QmlStyleUrlInterceptor.h @@ -32,6 +32,8 @@ //============================================================================ #include +#include "acss_globals.h" + namespace acss { class QtAdvancedStylesheet; @@ -64,7 +66,7 @@ class QtAdvancedStylesheet; * and turn them into absolute paths (with the help of the @c QtAdvancedStylesheet * instance passed in the constructor) that can be understood by QML. */ -class CQmlStyleUrlInterceptor : public QQmlAbstractUrlInterceptor +class ACSS_EXPORT CQmlStyleUrlInterceptor : public QQmlAbstractUrlInterceptor { public: /** diff --git a/src/QtAdvancedStylesheet.h b/src/QtAdvancedStylesheet.h index 9e2559a..5602fd5 100644 --- a/src/QtAdvancedStylesheet.h +++ b/src/QtAdvancedStylesheet.h @@ -34,7 +34,10 @@ #include #include -class QIcon; +#include "acss_globals.h" + + +QT_FORWARD_DECLARE_CLASS(QIcon) namespace acss { @@ -45,7 +48,7 @@ using tColorReplaceList = QVector; /** * Encapsulates all information about a single stylesheet based style */ -class QtAdvancedStylesheet : public QObject +class ACSS_EXPORT QtAdvancedStylesheet : public QObject { Q_OBJECT private: diff --git a/src/acss_globals.h b/src/acss_globals.h new file mode 100644 index 0000000..2d5b258 --- /dev/null +++ b/src/acss_globals.h @@ -0,0 +1,60 @@ +#ifndef acss_globalsH +#define acss_globalsH +/******************************************************************************* +** Qt Advanced Stylesheets +** Copyright (C) 2022 Uwe Kindler +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; If not, see . +******************************************************************************/ + + +//============================================================================ +/// \file ACSS_globals.h +/// \author Uwe Kindler +/// \date 19.04.2022 +//============================================================================ + + +//============================================================================ +// INCLUDES +//============================================================================ +#include +#include + + +#ifndef ACSS_STATIC +#ifdef ACSS_SHARED_EXPORT +#define ACSS_EXPORT Q_DECL_EXPORT +#else +#define ACSS_EXPORT Q_DECL_IMPORT +#endif +#else +#define ACSS_EXPORT +#endif + +// Define ACSS_DEBUG_PRINT to enable a lot of debug output +#ifdef ACSS_DEBUG_PRINT +#define ACSS_PRINT(s) qDebug() << s +#else +#define ACSS_PRINT(s) +#endif + +// Set ACSS_DEBUG_LEVEL to enable additional debug output and to enable layout +// dumps to qDebug and std::cout after layout changes +#define ACSS_DEBUG_LEVEL 0 + + + +//--------------------------------------------------------------------------- +#endif // acss_globalsH diff --git a/src/src.pro b/src/src.pro index 972b614..4c2efc4 100644 --- a/src/src.pro +++ b/src/src.pro @@ -30,6 +30,7 @@ windows { #RESOURCES += ads.qrc HEADERS += \ + acss_globals.h \ QmlStyleUrlInterceptor.h \ QtAdvancedStylesheet.h