Skip to content

Commit 60e0bbc

Browse files
committed
Add QtSvg sources
1 parent c276250 commit 60e0bbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+12210
-0
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ add_subdirectory(tools)
6767

6868
if(QT_FEATURE_gui)
6969
add_subdirectory(gui)
70+
add_subdirectory(svg)
7071

7172
if(QT_FEATURE_opengl)
7273
add_subdirectory(opengl)
7374
endif()
7475

7576
if(QT_FEATURE_widgets)
7677
add_subdirectory(widgets)
78+
add_subdirectory(svgwidgets)
7779
if(QT_FEATURE_opengl)
7880
add_subdirectory(openglwidgets)
7981
endif()

src/plugins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ if (TARGET Qt::Network)
2424
add_subdirectory(networkinformation)
2525
add_subdirectory(tls)
2626
endif()
27+
add_subdirectory(iconengines)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Generated from iconengines.pro.
2+
3+
add_subdirectory(svgiconengine)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated from svgiconengine.pro.
2+
3+
#####################################################################
4+
## QSvgIconPlugin Plugin:
5+
#####################################################################
6+
7+
qt_internal_add_plugin(QSvgIconPlugin
8+
OUTPUT_NAME qsvgicon
9+
PLUGIN_TYPE iconengines
10+
SOURCES
11+
main.cpp
12+
qsvgiconengine.cpp qsvgiconengine.h
13+
LIBRARIES
14+
Qt::Core
15+
Qt::CorePrivate
16+
Qt::Gui
17+
Qt::GuiPrivate
18+
Qt::Svg
19+
)
20+
21+
#### Keys ignored in scope 1:.:.:svgiconengine.pro:<TRUE>:
22+
# OTHER_FILES = "qsvgiconengine.json" "qsvgiconengine-nocompress.json"
23+
# PLUGIN_EXTENDS = "svg"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (C) 2016 The Qt Company Ltd.
2+
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3+
4+
#include <qiconengineplugin.h>
5+
#include <qstringlist.h>
6+
7+
#include "qsvgiconengine.h"
8+
9+
#include <qiodevice.h>
10+
#include <qbytearray.h>
11+
#include <qdebug.h>
12+
13+
QT_BEGIN_NAMESPACE
14+
15+
class QSvgIconPlugin : public QIconEnginePlugin
16+
{
17+
Q_OBJECT
18+
#ifndef QT_NO_COMPRESS
19+
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine.json")
20+
#else
21+
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine-nocompress.json")
22+
#endif
23+
24+
public:
25+
QIconEngine *create(const QString &filename = QString()) override;
26+
};
27+
28+
QIconEngine *QSvgIconPlugin::create(const QString &file)
29+
{
30+
QSvgIconEngine *engine = new QSvgIconEngine;
31+
if (!file.isNull())
32+
engine->addFile(file, QSize(), QIcon::Normal, QIcon::Off);
33+
return engine;
34+
}
35+
36+
QT_END_NAMESPACE
37+
38+
#include "main.moc"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Keys": [ "svg" ]
3+
}

0 commit comments

Comments
 (0)