QGIS/python/core/qgsexpressioncontextgenerator.sip
Matthias Kuhn 58ea21124e Streamline expression context generation (#3350)
* Save more data to QML

 * Virtual fields
 * Map tips
 * Display expression
 * Read only flag

* Streamline expression context generation

Whenever an object is able to generate an expression context it
implements the method createExpressionContext() declared in
QgsExpressionContextGenerator.

This makes a cleaner API and allows using QgsFieldExpressionWidget and
QgsDataDefinedButton from python because standard OO programming
approaches are used instead of callbacks and void pointers.

* Colorize output of doc and sip tests

* Fix build

* Fix sip complaints

* Fix rebase problems

* Workaround failing bindings test
2016-08-10 19:44:30 +02:00

42 lines
1.6 KiB
Plaintext

/***************************************************************************
qgsexpressioncontextgenerator.sip - QgsExpressionContextGenerator
---------------------
begin : 1.8.2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/**
* \ingroup core
* Abstract interface for generating an expression context.
*
* You need to implement this interface in a class and register this class with
* QgsFieldExpressionWidget::registerExpressionGenerator().
*
* Whenever this widget requires an expression context it will call the createExpressionContext()
* method to get a context.
*
* @note added in QGIS 3.0
*/
class QgsExpressionContextGenerator
{
%TypeHeaderCode
#include "qgsexpressioncontextgenerator.h"
%End
public:
/**
* This method needs to be reimplemented in all classes which implement this interface
* and return an expression context.
*/
virtual QgsExpressionContext createExpressionContext() const = 0;
};