QGIS API Documentation 3.99.0-Master (26c88405ac0)
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 <QUuid>
21
23
24QgsProcessingModelGroupBox::QgsProcessingModelGroupBox( const QString &description )
25 : QgsProcessingModelComponent( description )
26 , mUuid( QUuid::createUuid().toString() )
27{
28 setSize( QSizeF( 400, 360 ) );
29}
30
31QgsProcessingModelGroupBox *QgsProcessingModelGroupBox::clone() const
32{
33 return new QgsProcessingModelGroupBox( *this );
34}
35
36QVariant QgsProcessingModelGroupBox::toVariant() const
37{
38 QVariantMap map;
39 map.insert( QStringLiteral( "uuid" ), mUuid );
40 saveCommonProperties( map );
41 return map;
42}
43
44bool QgsProcessingModelGroupBox::loadVariant( const QVariantMap &map, bool ignoreUuid )
45{
46 restoreCommonProperties( map );
47 if ( !ignoreUuid )
48 mUuid = map.value( QStringLiteral( "uuid" ) ).toString();
49 return true;
50}
51
52QString QgsProcessingModelGroupBox::uuid() const
53{
54 return mUuid;
55}
56
57