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