QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
qgsprocessingmodelchilddependency.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingmodelchilddependency.h
3 -----------------------------
4 begin : April 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
18#ifndef QGSPROCESSINGMODELCHILDDEPENDENCY_H
19#define QGSPROCESSINGMODELCHILDDEPENDENCY_H
20
21#include "qgis.h"
22#include "qgis_core.h"
23
24#include <QString>
25
26using namespace Qt::StringLiterals;
27
29
36class CORE_EXPORT QgsProcessingModelChildDependency
37{
38 public:
42 QgsProcessingModelChildDependency( const QString &childId = QString(), const QString &conditionalBranch = QString() )
43 : childId( childId )
44 , conditionalBranch( conditionalBranch )
45 {}
46
48 QString childId;
49
51 QString conditionalBranch;
52
57 QVariant toVariant() const
58 {
59 QVariantMap res;
60 res.insert( u"child_id"_s, childId );
61 res.insert( u"conditional_branch"_s, conditionalBranch );
62 return res;
63 }
64
69 bool loadVariant( const QVariantMap &map )
70 {
71 childId = map.value( u"child_id"_s ).toString();
72 conditionalBranch = map.value( u"conditional_branch"_s ).toString();
73 return true;
74 }
75
76 // TODO c++20 - replace with = default
77 bool operator==( const QgsProcessingModelChildDependency &other ) const { return childId == other.childId && conditionalBranch == other.conditionalBranch; }
78
79 bool operator!=( const QgsProcessingModelChildDependency &other ) const { return !( *this == other ); }
80
81 bool operator<( const QgsProcessingModelChildDependency &other ) const { return childId == other.childId ? conditionalBranch < other.conditionalBranch : childId < other.childId; }
82};
83
84Q_DECLARE_METATYPE( QgsProcessingModelChildDependency )
85
86
87
88#endif // QGSPROCESSINGMODELCHILDDEPENDENCY_H
bool operator<(const QVariant &v1, const QVariant &v2)
Compares two QVariant values and returns whether the first is less than the second.
Definition qgis.h:7396
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)