QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsquickplugin.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickplugin.cpp
3  --------------------------------------
4  Date : Nov 2017
5  Copyright : (C) 2017 by Peter Petrik
6  Email : zilolv at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include <qqml.h>
17 
18 #include <QObject>
19 #include <QQmlEngine>
20 #include <QJSEngine>
21 
22 #include "qgsfeature.h"
23 #include "qgslogger.h"
24 #include "qgsmaplayer.h"
25 #include "qgsmessagelog.h"
26 #include "qgspointxy.h"
27 #include "qgsproject.h"
28 #include "qgsrelationmanager.h"
30 #include "qgscoordinateformatter.h"
31 #include "qgsvectorlayer.h"
32 #include "qgsunittypes.h"
33 
34 #include "qgsquickmapcanvasmap.h"
35 #include "qgsquickmapsettings.h"
36 #include "qgsquickmaptransform.h"
37 #include "qgsquickplugin.h"
38 
39 void QgsQuickPlugin::registerTypes( const char *uri )
40 {
41  qRegisterMetaType< QList<QgsMapLayer *> >( "QList<QgsMapLayer*>" );
42  qRegisterMetaType< QgsAttributes > ( "QgsAttributes" );
43  qRegisterMetaType< QgsCoordinateReferenceSystem >( "QgsCoordinateReferenceSystem" );
44  qRegisterMetaType< QgsCoordinateTransformContext >( "QgsCoordinateTransformContext" );
45  qRegisterMetaType< QgsFeature > ( "QgsFeature" );
46  qRegisterMetaType< QgsFeatureId > ( "QgsFeatureId" );
47  qRegisterMetaType< QgsPoint >( "QgsPoint" );
48  qRegisterMetaType< QgsPointXY >( "QgsPointXY" );
49  qRegisterMetaType< QgsUnitTypes::SystemOfMeasurement >( "QgsUnitTypes::SystemOfMeasurement" );
50  qRegisterMetaType< QgsUnitTypes::DistanceUnit >( "QgsUnitTypes::DistanceUnit" );
51  qRegisterMetaType< QgsCoordinateFormatter::FormatFlags >( "QgsCoordinateFormatter::FormatFlags" );
52  qRegisterMetaType< QgsCoordinateFormatter::Format >( "QgsCoordinateFormatter::Format" );
53  qRegisterMetaType< QVariant::Type >( "QVariant::Type" );
54 
55  qmlRegisterUncreatableType< QgsUnitTypes >( uri, 0, 1, "QgsUnitTypes", "Only enums from QgsUnitTypes can be used" );
56  qmlRegisterType< QgsProject >( uri, 0, 1, "Project" );
57  qmlRegisterType< QgsQuickMapCanvasMap >( uri, 0, 1, "MapCanvasMap" );
58  qmlRegisterType< QgsQuickMapSettings >( uri, 0, 1, "MapSettings" );
59  qmlRegisterType< QgsQuickMapTransform >( uri, 0, 1, "MapTransform" );
60  qmlRegisterType< QgsVectorLayer >( uri, 0, 1, "VectorLayer" );
61 }
qgsquickplugin.h
qgscoordinatetransformcontext.h
qgsfeature.h
qgsunittypes.h
qgsquickmaptransform.h
QgsQuickPlugin::registerTypes
void registerTypes(const char *uri)
Registers the QGIS QML types in the given uri.
Definition: qgsquickplugin.cpp:39
qgsquickmapcanvasmap.h
qgsmaplayer.h
qgsrelationmanager.h
qgsvectorlayer.h
qgslogger.h
qgscoordinateformatter.h
qgsquickmapsettings.h
qgsproject.h
qgspointxy.h
qgsmessagelog.h