diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-28 17:12:49 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-29 11:55:53 +0200 |
commit | 778c95d7a181e702766bf0cdf63c50dd1e7d9d9b (patch) | |
tree | 9b27aaef3dd0974f667091e102fc38483c66fb2f /src | |
parent | c5259f018a9bc4aa3edd94810f1044de1b348fa8 (diff) | |
download | qtsvg-778c95d7a181e702766bf0cdf63c50dd1e7d9d9b.tar.gz |
Move QSvgWidget and QGraphicsSvgItem into separate module
Long live QtSvgWidgets. This makes QtSvg independent of QtWidgets.
Fixes: QTBUG-41884
Change-Id: I421d27d35b651ee8cdf1a5280d5594b82359ddab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/src.pro | 1 | ||||
-rw-r--r-- | src/svg/.prev_CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/svg/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/svg/qtsvgglobal.h | 2 | ||||
-rw-r--r-- | src/svg/svg.pro | 4 | ||||
-rw-r--r-- | src/svgwidgets/.prev_CMakeLists.txt | 25 | ||||
-rw-r--r-- | src/svgwidgets/CMakeLists.txt | 25 | ||||
-rw-r--r-- | src/svgwidgets/qgraphicssvgitem.cpp (renamed from src/svg/qgraphicssvgitem.cpp) | 10 | ||||
-rw-r--r-- | src/svgwidgets/qgraphicssvgitem.h (renamed from src/svg/qgraphicssvgitem.h) | 12 | ||||
-rw-r--r-- | src/svgwidgets/qsvgwidget.cpp (renamed from src/svg/qsvgwidget.cpp) | 10 | ||||
-rw-r--r-- | src/svgwidgets/qsvgwidget.h (renamed from src/svg/qsvgwidget.h) | 12 | ||||
-rw-r--r-- | src/svgwidgets/qtsvgwidgetsglobal.h | 61 | ||||
-rw-r--r-- | src/svgwidgets/svgwidgets.pro | 16 |
14 files changed, 149 insertions, 46 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f1b6e3b..344fbe5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,3 +4,7 @@ if(TARGET Qt::Gui) add_subdirectory(svg) add_subdirectory(plugins) endif() + +if(TARGET Qt::Widgets) + add_subdirectory(svgwidgets) +endif() diff --git a/src/src.pro b/src/src.pro index a1b5d69..1a1d4d4 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs CONFIG += ordered qtHaveModule(gui): SUBDIRS += svg plugins +qtHaveModule(widgets): SUBDIRS += svgwidgets diff --git a/src/svg/.prev_CMakeLists.txt b/src/svg/.prev_CMakeLists.txt index bf9e056..31374ee 100644 --- a/src/svg/.prev_CMakeLists.txt +++ b/src/svg/.prev_CMakeLists.txt @@ -6,7 +6,6 @@ qt_add_module(Svg SOURCES - qgraphicssvgitem.cpp qgraphicssvgitem.h qsvgfont.cpp qsvgfont_p.h qsvggenerator.cpp qsvggenerator.h qsvggraphics.cpp qsvggraphics_p.h @@ -16,7 +15,6 @@ qt_add_module(Svg qsvgstructure.cpp qsvgstructure_p.h qsvgstyle.cpp qsvgstyle_p.h qsvgtinydocument.cpp qsvgtinydocument_p.h - qsvgwidget.cpp qsvgwidget.h qtsvgglobal.h DEFINES QT_NO_USING_NAMESPACE @@ -34,15 +32,6 @@ qt_add_module(Svg ## Scopes: ##################################################################### -qt_extend_target(Svg CONDITION TARGET Qt::Widgets - LIBRARIES - Qt::WidgetsPrivate - PUBLIC_LIBRARIES - Qt::Widgets - PRIVATE_MODULE_INTERFACE - Qt::WidgetsPrivate -) - qt_extend_target(Svg CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x66000000" diff --git a/src/svg/CMakeLists.txt b/src/svg/CMakeLists.txt index 241b5fc..ca09b70 100644 --- a/src/svg/CMakeLists.txt +++ b/src/svg/CMakeLists.txt @@ -15,7 +15,6 @@ endif() qt_add_module(Svg SOURCES - qgraphicssvgitem.cpp qgraphicssvgitem.h qsvgfont.cpp qsvgfont_p.h qsvggenerator.cpp qsvggenerator.h qsvggraphics.cpp qsvggraphics_p.h @@ -25,7 +24,6 @@ qt_add_module(Svg qsvgstructure.cpp qsvgstructure_p.h qsvgstyle.cpp qsvgstyle_p.h qsvgtinydocument.cpp qsvgtinydocument_p.h - qsvgwidget.cpp qsvgwidget.h qtsvgglobal.h DEFINES QT_NO_USING_NAMESPACE diff --git a/src/svg/qtsvgglobal.h b/src/svg/qtsvgglobal.h index 5c79e2c..92075c9 100644 --- a/src/svg/qtsvgglobal.h +++ b/src/svg/qtsvgglobal.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the Qt SVG module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/svg/svg.pro b/src/svg/svg.pro index b6f17a7..9d70df8 100644 --- a/src/svg/svg.pro +++ b/src/svg/svg.pro @@ -17,8 +17,6 @@ HEADERS += \ qsvgfont_p.h \ qsvgtinydocument_p.h \ qsvgrenderer.h \ - qsvgwidget.h \ - qgraphicssvgitem.h \ qsvggenerator.h \ qtsvgglobal.h @@ -32,8 +30,6 @@ SOURCES += \ qsvgfont.cpp \ qsvgtinydocument.cpp \ qsvgrenderer.cpp \ - qsvgwidget.cpp \ - qgraphicssvgitem.cpp \ qsvggenerator.cpp qtConfig(system-zlib): \ diff --git a/src/svgwidgets/.prev_CMakeLists.txt b/src/svgwidgets/.prev_CMakeLists.txt new file mode 100644 index 0000000..afbe83e --- /dev/null +++ b/src/svgwidgets/.prev_CMakeLists.txt @@ -0,0 +1,25 @@ +##################################################################### +## SvgWidgets Module: +##################################################################### + +qt_add_module(SvgWidgets + SOURCES + qtsvgwidgetsglobal.h + qgraphicssvgitem.cpp qgraphicssvgitem.h + qsvgwidget.cpp qsvgwidget.h + DEFINES + QT_NO_USING_NAMESPACE + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Widgets + Qt::Svg + PRIVATE_MODULE_INTERFACE + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate +) diff --git a/src/svgwidgets/CMakeLists.txt b/src/svgwidgets/CMakeLists.txt new file mode 100644 index 0000000..afbe83e --- /dev/null +++ b/src/svgwidgets/CMakeLists.txt @@ -0,0 +1,25 @@ +##################################################################### +## SvgWidgets Module: +##################################################################### + +qt_add_module(SvgWidgets + SOURCES + qtsvgwidgetsglobal.h + qgraphicssvgitem.cpp qgraphicssvgitem.h + qsvgwidget.cpp qsvgwidget.h + DEFINES + QT_NO_USING_NAMESPACE + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Widgets + Qt::Svg + PRIVATE_MODULE_INTERFACE + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate +) diff --git a/src/svg/qgraphicssvgitem.cpp b/src/svgwidgets/qgraphicssvgitem.cpp index fe6e92e..f1dd252 100644 --- a/src/svg/qgraphicssvgitem.cpp +++ b/src/svgwidgets/qgraphicssvgitem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt SVG module of the Qt Toolkit. @@ -38,15 +38,15 @@ ****************************************************************************/ #include "qgraphicssvgitem.h" -#if !defined(QT_NO_GRAPHICSVIEW) && !defined(QT_NO_WIDGETS) +#if !defined(QT_NO_GRAPHICSVIEW) #include "qpainter.h" #include "qstyleoption.h" #include "qsvgrenderer.h" #include "qdebug.h" -#include "private/qobject_p.h" -#include "private/qgraphicsitem_p.h" +#include <QtCore/private/qobject_p.h> +#include <QtWidgets/private/qgraphicsitem_p.h> QT_BEGIN_NAMESPACE @@ -385,4 +385,4 @@ QT_END_NAMESPACE #include "moc_qgraphicssvgitem.cpp" -#endif // QT_NO_WIDGETS +#endif // QT_NO_GRAPHICSVIEW diff --git a/src/svg/qgraphicssvgitem.h b/src/svgwidgets/qgraphicssvgitem.h index 5102b91..fa2db61 100644 --- a/src/svg/qgraphicssvgitem.h +++ b/src/svgwidgets/qgraphicssvgitem.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt SVG module of the Qt Toolkit. @@ -39,21 +39,19 @@ #ifndef QGRAPHICSSVGITEM_H #define QGRAPHICSSVGITEM_H -#include <QtCore/qglobal.h> +#include <QtSvgWidgets/qtsvgwidgetsglobal.h> -#if !defined(QT_NO_GRAPHICSVIEW) && !defined(QT_NO_WIDGETS) +#if !defined(QT_NO_GRAPHICSVIEW) #include <QtWidgets/qgraphicsitem.h> -#include <QtSvg/qtsvgglobal.h> - QT_BEGIN_NAMESPACE class QSvgRenderer; class QGraphicsSvgItemPrivate; -class Q_SVG_EXPORT QGraphicsSvgItem : public QGraphicsObject +class Q_SVGWIDGETS_EXPORT QGraphicsSvgItem : public QGraphicsObject { Q_OBJECT Q_INTERFACES(QGraphicsItem) @@ -94,6 +92,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_GRAPHICSVIEW or QT_NO_WIDGETS +#endif // QT_NO_GRAPHICSVIEW #endif // QGRAPHICSSVGITEM_H diff --git a/src/svg/qsvgwidget.cpp b/src/svgwidgets/qsvgwidget.cpp index acc8cca..6c80be1 100644 --- a/src/svg/qsvgwidget.cpp +++ b/src/svgwidgets/qsvgwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt SVG module of the Qt Toolkit. @@ -39,13 +39,11 @@ #include "qsvgwidget.h" -#ifndef QT_NO_WIDGETS - -#include "qsvgrenderer.h" +#include <qsvgrenderer.h> #include "qstyleoption.h" #include "qpainter.h" -#include "private/qwidget_p.h" +#include <QtWidgets/private/qwidget_p.h> QT_BEGIN_NAMESPACE @@ -172,5 +170,3 @@ void QSvgWidget::load(const QByteArray &contents) } QT_END_NAMESPACE - -#endif // QT_NO_WIDGETS diff --git a/src/svg/qsvgwidget.h b/src/svgwidgets/qsvgwidget.h index 8f6dd44..5e4cecd 100644 --- a/src/svg/qsvgwidget.h +++ b/src/svgwidgets/qsvgwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt SVG module of the Qt Toolkit. @@ -40,13 +40,9 @@ #ifndef QSVGWIDGET_H #define QSVGWIDGET_H -#include <QtCore/qglobal.h> - -#ifndef QT_NO_WIDGETS - +#include <QtSvgWidgets/qtsvgwidgetsglobal.h> #include <QtWidgets/qwidget.h> -#include <QtSvg/qtsvgglobal.h> QT_BEGIN_NAMESPACE @@ -55,7 +51,7 @@ class QSvgWidgetPrivate; class QPaintEvent; class QSvgRenderer; -class Q_SVG_EXPORT QSvgWidget : public QWidget +class Q_SVGWIDGETS_EXPORT QSvgWidget : public QWidget { Q_OBJECT public: @@ -78,6 +74,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_WIDGETS - #endif // QSVGWIDGET_H diff --git a/src/svgwidgets/qtsvgwidgetsglobal.h b/src/svgwidgets/qtsvgwidgetsglobal.h new file mode 100644 index 0000000..9802247 --- /dev/null +++ b/src/svgwidgets/qtsvgwidgetsglobal.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt SVG module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTSVGWIDGETSGLOBAL_H +#define QTSVGWIDGETSGLOBAL_H + +#include <QtCore/qglobal.h> + +QT_BEGIN_NAMESPACE + +#ifndef Q_SVGWIDGETS_EXPORT +# ifndef QT_STATIC +# if defined(QT_BUILD_SVGWIDGETS_LIB) +# define Q_SVGWIDGETS_EXPORT Q_DECL_EXPORT +# else +# define Q_SVGWIDGETS_EXPORT Q_DECL_IMPORT +# endif +# else +# define Q_SVGWIDGETS_EXPORT +# endif +#endif + +QT_END_NAMESPACE + +#endif diff --git a/src/svgwidgets/svgwidgets.pro b/src/svgwidgets/svgwidgets.pro new file mode 100644 index 0000000..2f99b56 --- /dev/null +++ b/src/svgwidgets/svgwidgets.pro @@ -0,0 +1,16 @@ +TARGET = QtSvgWidgets +QT += svg core-private gui-private widgets-private + +DEFINES += QT_NO_USING_NAMESPACE +msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x66000000 + +HEADERS += \ + qtsvgwidgetsglobal.h \ + qsvgwidget.h \ + qgraphicssvgitem.h + +SOURCES += \ + qsvgwidget.cpp \ + qgraphicssvgitem.cpp + +load(qt_module) |