QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsdatadefined_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdatadefined_p.h
3  -----------------
4  Date : May-2015
5  Copyright : (C) 2015 by Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSDATADEFINED_PRIVATE_H
16 #define QGSDATADEFINED_PRIVATE_H
17 
19 
20 //
21 // W A R N I N G
22 // -------------
23 //
24 // This file is not part of the QGIS API. It exists purely as an
25 // implementation detail. This header file may change from version to
26 // version without notice, or even be removed.
27 //
28 
29 #include <QStringList>
30 #include <QMap>
31 #include <QSharedData>
32 #include "qgsexpression.h"
33 
34 
35 class QgsDataDefinedPrivate : public QSharedData
36 {
37  public:
38 
39  QgsDataDefinedPrivate( bool active = false,
40  bool useExpression = false,
41  const QString& expressionString = QString(),
42  const QString& field = QString() )
43  : expression( nullptr )
44  , active( active )
45  , useExpression( useExpression )
46  , expressionString( expressionString )
47  , field( field )
48  , expressionPrepared( false )
49  {
50  }
51 
52  QgsDataDefinedPrivate( const QgsDataDefinedPrivate& other )
53  : QSharedData( other )
54  , expression( nullptr )
55  , active( other.active )
56  , useExpression( other.useExpression )
57  , expressionString( other.expressionString )
58  , field( other.field )
59  , expressionParams( other.expressionParams )
60  , expressionPrepared( false )
61  , exprRefColumns( other.exprRefColumns )
62  {
63  }
64 
65  ~QgsDataDefinedPrivate()
66  {
67  delete expression;
68  }
69 
70  bool operator==( const QgsDataDefinedPrivate& other ) const
71  {
72  return (( active == other.active ) && ( useExpression == other.useExpression )
73  && ( expressionString == other.expressionString ) && ( field == other.field ) );
74  }
75 
76  QgsExpression* expression;
77 
78  bool active;
79  bool useExpression;
80  QString expressionString;
81  QString field;
82 
83  QMap<QString, QVariant> expressionParams;
84  bool expressionPrepared;
85  QStringList exprRefColumns;
86 };
87 
89 
90 #endif // QGSDATADEFINED_PRIVATE_H
Class for parsing and evaluation of expressions (formerly called "search strings").
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)