QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsprocessingmodelgroupbox.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingmodelgroupbox.cpp
3 --------------------------
4 begin : March 2020
5 copyright : (C) 2020 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#include <QUuid>
22
23using namespace Qt::StringLiterals;
24
26
27QgsProcessingModelGroupBox::QgsProcessingModelGroupBox( const QString &description )
28 : QgsProcessingModelComponent( description )
29 , mUuid( QUuid::createUuid().toString() )
30{
31 setSize( QSizeF( 400, 360 ) );
32}
33
34QgsProcessingModelGroupBox *QgsProcessingModelGroupBox::clone() const
35{
36 return new QgsProcessingModelGroupBox( *this );
37}
38
39QVariant QgsProcessingModelGroupBox::toVariant() const
40{
41 QVariantMap map;
42 map.insert( u"uuid"_s, mUuid );
43 saveCommonProperties( map );
44 return map;
45}
46
47bool QgsProcessingModelGroupBox::loadVariant( const QVariantMap &map, bool ignoreUuid )
48{
49 restoreCommonProperties( map );
50 if ( !ignoreUuid )
51 mUuid = map.value( u"uuid"_s ).toString();
52 return true;
53}
54
55QString QgsProcessingModelGroupBox::uuid() const
56{
57 return mUuid;
58}
59
60