Skip to content
Permalink
Browse files

fix windows build (tests & bindings)

(cherry picked from commit 0c1792a)
  • Loading branch information
jef-n committed Sep 14, 2016
1 parent 5c1151c commit 3f3e206a7300ec8409bba4212e79c659af24f5d9
Showing with 30 additions and 14 deletions.
  1. +24 −12 python/core/qgsoptionalexpression.sip
  2. +6 −2 src/core/qgsoptionalexpression.h
@@ -15,43 +15,55 @@
***************************************************************************/

/**
* \ingroup core
* An expression with an additional enabled flag.
*
* QgsOptionalExpression is a container for an expression with an additional enabled/disabled flag.
* This can be used for configuration options where an expression can be enabled
* or diabled but when disabled it shouldn't lose it's information for the case
* it gets re-enabled later on and a user shouldn't be force to redo the configuration.
*
* @note Added in QGIS 3.0
*/

class QgsOptionalExpression
{
%TypeHeaderCode
#include <qgsoptionalexpression.h>
%End
public:
/**
* A QgsOptionalExpression is disabled by default if default constructed.
* Construct a default optional expression.
* It will be disabled and with an empty expression.
*/
QgsOptionalExpression();

/**
* A QgsOptionalExpression is enabled by default if constructed with an expression.
* Construct an optional expression with the provided expression.
* It will be enabled.
*/
QgsOptionalExpression( const QgsExpression& data );
QgsOptionalExpression( const QgsExpression& expression );

/**
* A QgsOptionalExptression constructed with enabled status and data
* Construct an optional expression with the provided expression and enabled state.
*/
QgsOptionalExpression( const QgsExpression& data, bool enabled );
QgsOptionalExpression( const QgsExpression& expression, bool enabled );

/**
* Compare this QgsOptionalExptression to another one.
* Compare this QgsOptionalExpression to another one.
*
* This will compare the enabled flag and call the == operator
* of the contained class.
*
* @note Added in QGIS 3.0
*/
bool operator== ( const QgsOptionalExpression& other ) const;
operator bool () const;
int operator== ( const QgsOptionalExpression& other ) const;
%MethodCode
sipRes = *sipCpp == *a0;
%End

int __bool__() const;
%MethodCode
sipRes = sipCpp->enabled();
%End

/**
* Check if this optional is enabled
@@ -89,12 +101,12 @@ class QgsOptionalExpression
*
* @note Added in QGIS 2.18
*/
void writeXml(QDomElement& parent );
void writeXml( QDomElement& element );

/**
* Read the optional expression from the provided QDomElement.
*
* @note Added in QGIS 2.18
*/
void readXml(const QDomElement& parent );
void readXml( const QDomElement& element );
};
@@ -1,5 +1,5 @@
/***************************************************************************
qgsoptionalexpression - %{Cpp:License:ClassName}
qgsoptionalexpression.h - QgsOptionalExpression
---------------------
begin : 8.9.2016
@@ -26,7 +26,7 @@
*
* This can be used for configuration options where an expression can be enabled
* or diabled but when disabled it shouldn't lose it's information for the case
* it gets re-enabled later on and a user shoulnd't be force to redo the configuration.
* it gets re-enabled later on and a user shouldn't be force to redo the configuration.
*
* @note Added in QGIS 2.18
*/
@@ -69,4 +69,8 @@ class CORE_EXPORT QgsOptionalExpression : public QgsOptional<QgsExpression>
void readXml( const QDomElement& element );
};

#if defined(Q_OS_WIN)
template CORE_EXPORT QgsOptional<QgsExpression>;
#endif

#endif // QGSOPTIONALEXPRESSION_H

0 comments on commit 3f3e206

Please sign in to comment.
You can’t perform that action at this time.