QGIS API Documentation 3.99.0-Master (d270888f95f)
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
30}
31
32QgsProcessingModelParameter *QgsProcessingModelParameter::clone() const
33{
34 return new QgsProcessingModelParameter( *this );
35}
36
37QVariant QgsProcessingModelParameter::toVariant() const
38{
39 QVariantMap map;
40 map.insert( u"name"_s, mParameterName );
41 saveCommonProperties( map );
42 return map;
43}
44
45bool QgsProcessingModelParameter::loadVariant( const QVariantMap &map )
46{
47 mParameterName = map.value( u"name"_s ).toString();
48 restoreCommonProperties( map );
49 return true;
50}
51