QGIS/python/gui/qgsfieldcombobox.sip

110 lines
3.2 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldcombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2014-03-24 22:53:10 +01:00
class QgsFieldComboBox : QComboBox
{
%Docstring
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
2017-12-15 10:36:55 -04:00
It might be combined with a QgsMapLayerComboBox to automatically update fields according to a chosen layer.
If expression must be used, QgsFieldExpressionWidget shall be used instead.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapLayerComboBox`
2017-12-15 10:36:55 -04:00
.. versionadded:: 2.3
%End
2014-03-24 22:53:10 +01:00
%TypeHeaderCode
#include "qgsfieldcombobox.h"
%End
public:
2014-03-24 22:53:10 +01:00
explicit QgsFieldComboBox( QWidget *parent /TransferThis/ = 0 );
%Docstring
QgsFieldComboBox creates a combo box to display the fields of a layer.
2017-12-15 10:36:55 -04:00
The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox.layerChanged to the slot setLayer.
%End
2014-03-24 22:53:10 +01:00
void setFilters( QgsFieldProxyModel::Filters filters );
%Docstring
setFilters allows fitering according to the type of field
%End
2014-09-01 16:45:54 +02:00
QgsFieldProxyModel::Filters filters() const;
%Docstring
currently used filter on list of fields
%End
void setAllowEmptyFieldName( bool allowEmpty );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether an optional empty field ("not set") option is shown in the combo box.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`allowEmptyFieldName()`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
bool allowEmptyFieldName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the combo box allows the empty field ("not set") choice.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setAllowEmptyFieldName()`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
2014-09-01 16:45:54 +02:00
QString currentField() const;
%Docstring
return the currently selected field
%End
QgsVectorLayer *layer() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer currently associated with the combobox.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLayer()`
%End
2014-03-24 22:53:10 +01:00
signals:
void fieldChanged( const QString &fieldName );
%Docstring
the signal is emitted when the currently selected field changes
%End
2014-03-24 22:53:10 +01:00
public slots:
2014-05-02 10:32:37 +02:00
void setLayer( QgsMapLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the layer for which fields are listed in the combobox. If no layer is set
or a non-vector layer is set then the combobox will be empty.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`layer()`
%End
void setField( const QString &fieldName );
%Docstring
setField sets the currently selected field
%End
protected slots:
void indexChanged( int i );
2014-03-24 22:53:10 +01:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldcombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/