QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsprocessingmodelparameter.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingmodelparameter.cpp
3 ------------------------------
4 begin : June 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include <QString>
21
22using namespace Qt::StringLiterals;
23
25
26QgsProcessingModelParameter::QgsProcessingModelParameter( const QString &parameterName )
27 : mParameterName( parameterName )
28{}
29
30QgsProcessingModelParameter *QgsProcessingModelParameter::clone() const
31{
32 return new QgsProcessingModelParameter( *this );
33}
34
35QVariant QgsProcessingModelParameter::toVariant() const
36{
37 QVariantMap map;
38 map.insert( u"name"_s, mParameterName );
39 saveCommonProperties( map );
40 return map;
41}
42
43bool QgsProcessingModelParameter::loadVariant( const QVariantMap &map )
44{
45 mParameterName = map.value( u"name"_s ).toString();
46 restoreCommonProperties( map );
47 return true;
48}
49