QGIS/python/gui/qgspropertyoverridebutton.sip.in

246 lines
7.7 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgspropertyoverridebutton.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsPropertyOverrideButton: QToolButton
2017-01-19 18:54:16 +10:00
{
%Docstring
2017-12-15 10:36:55 -04:00
A button for controlling property overrides which may apply to a widget.
2017-12-15 10:36:55 -04:00
QgsPropertyOverrideButton is designed to be used alongside the QGIS
properties framework (QgsProperty, QgsPropertyDefinition
and QgsPropertyCollection).
It allows users to specify field or expression based overrides
which should be applied to a property of an object. Eg, this widget
is used for controlling data defined overrides in symbology, labeling
2018-01-11 06:52:24 +10:00
and layouts.
.. versionadded:: 3.0
%End
2017-01-19 18:54:16 +10:00
%TypeHeaderCode
#include "qgspropertyoverridebutton.h"
2017-01-19 18:54:16 +10:00
%End
public:
QgsPropertyOverrideButton( QWidget *parent /TransferThis/ = 0,
const QgsVectorLayer *layer = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsPropertyOverrideButton.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parent: parent widget
:param layer: associated vector layer
%End
2017-01-19 18:54:16 +10:00
void init( int propertyKey,
const QgsProperty &property,
const QgsPropertiesDefinition &definitions,
const QgsVectorLayer *layer = 0,
bool auxiliaryStorageEnabled = false );
%Docstring
2017-12-15 10:36:55 -04:00
Initialize a newly constructed property button (useful if button was included in a UI layout).
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definitions: properties definitions for corresponding collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If true, activate the button to store data defined in auxiliary storage
%End
2017-01-19 18:54:16 +10:00
void init( int propertyKey,
const QgsProperty &property,
const QgsPropertyDefinition &definition,
const QgsVectorLayer *layer = 0,
bool auxiliaryStorageEnabled = false );
%Docstring
2017-12-15 10:36:55 -04:00
Initialize a newly constructed property button (useful if button was included in a UI layout).
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definition: properties definition for button
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If true, activate the button to store data defined in auxiliary storage
%End
2017-01-19 18:54:16 +10:00
void init( int propertyKey,
const QgsAbstractPropertyCollection &collection,
const QgsPropertiesDefinition &definitions,
const QgsVectorLayer *layer = 0,
bool auxiliaryStorageEnabled = false );
%Docstring
2017-12-15 10:36:55 -04:00
Initialize a newly constructed property button (useful if button was included in a UI layout).
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param propertyKey: key for corresponding property
:param collection: associated property collection
:param definitions: properties definitions for collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If true, activate the button to store data defined in auxiliary storage
%End
2017-01-19 18:54:16 +10:00
QgsProperty toProperty() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a QgsProperty object encapsulating the current state of the
widget.
.. seealso:: :py:func:`setToProperty`
%End
2017-01-19 18:54:16 +10:00
void setToProperty( const QgsProperty &property );
%Docstring
2017-12-19 11:43:52 -04:00
Sets the widget to reflect the current state of a :py:class:`QgsProperty`.
%End
2017-01-19 18:54:16 +10:00
int propertyKey() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the property key linked to the button.
%End
2017-01-19 18:54:16 +10:00
bool isActive() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the button has an active property.
%End
2017-01-19 18:54:16 +10:00
QgsPropertyDefinition::DataType validDataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the data type which the widget will accept. This is used to filter
out fields from the associated vector layer to only show fields which
are compatible with the property.
%End
2017-01-19 18:54:16 +10:00
QString fullDescription() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the full definition description and current definition
(internally generated on a contextual basis).
%End
2017-01-19 18:54:16 +10:00
QString usageInfo() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns usage information for the property.
.. seealso:: :py:func:`setUsageInfo`
%End
2017-01-19 18:54:16 +10:00
void setUsageInfo( const QString &info );
%Docstring
2017-12-15 10:36:55 -04:00
Set the usage information for the property.
.. seealso:: :py:func:`usageInfo`
%End
2017-01-19 18:54:16 +10:00
void setVectorLayer( const QgsVectorLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the vector layer associated with the button. This controls which fields are
displayed within the widget's pop up menu.
.. seealso:: :py:func:`vectorLayer`
%End
2017-01-19 18:54:16 +10:00
const QgsVectorLayer *vectorLayer() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector layer associated with the button. This controls which fields are
displayed within the widget's pop up menu.
.. seealso:: :py:func:`setVectorLayer`
%End
2017-01-19 18:54:16 +10:00
void registerCheckedWidget( QWidget *widget, bool natural = true );
%Docstring
2017-12-15 10:36:55 -04:00
Register a sibling ``widget`` that gets checked when the property is active.
if ``natural`` is false, widget gets unchecked when the property is active.
.. note::
this should be called after calling init() to be correctly initialized.
%End
void registerEnabledWidget( QWidget *widget, bool natural = true );
%Docstring
2017-12-15 10:36:55 -04:00
Register a sibling ``widget`` that gets enabled when the property is active, and disabled when the property is inactive.
if ``natural`` is false, widget gets disabled when the property is active, and enabled when the property is inactive.
.. note::
this should be called after calling init() to be correctly initialized.
%End
void registerVisibleWidget( QWidget *widget, bool natural = true );
%Docstring
2017-12-15 10:36:55 -04:00
Register a sibling ``widget`` that gets visible when the property is active, and hidden when the property is inactive.
if ``natural`` is false, widget gets hidden when the property is active, and visible when the property is inactive.
.. note::
this should be called after calling init() to be correctly initialized.
%End
void registerExpressionWidget( QWidget *widget );
%Docstring
2017-12-15 10:36:55 -04:00
Register a sibling ``widget`` (line edit, text edit) that will receive the property as an expression
.. note::
this should be called after calling init() to be correctly initialized.
%End
2017-01-19 18:54:16 +10:00
void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
%Docstring
2017-12-15 10:36:55 -04:00
Register an expression context generator class that will be used to retrieve
an expression context for the button when required.
%End
void updateFieldLists();
%Docstring
2017-12-15 10:36:55 -04:00
Updates list of fields.
.. versionadded:: 3.0
%End
2017-01-19 18:54:16 +10:00
public slots:
void setActive( bool active );
%Docstring
2017-12-15 10:36:55 -04:00
Set whether the current property override definition is to be used
%End
2017-01-19 18:54:16 +10:00
signals:
void changed();
%Docstring
Emitted when property definition changes
%End
2017-01-19 18:54:16 +10:00
void activated( bool isActive );
%Docstring
Emitted when the activated status of the widget changes
%End
void createAuxiliaryField();
%Docstring
Emitted when creating a new auxiliary field
%End
2017-01-19 18:54:16 +10:00
protected:
virtual void mouseReleaseEvent( QMouseEvent *event );
2017-01-19 18:54:16 +10:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgspropertyoverridebutton.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/