mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
133 lines
3.8 KiB
Plaintext
133 lines
3.8 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgsfieldcombobox.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsFieldComboBox : QComboBox
|
|
{
|
|
%Docstring
|
|
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
|
|
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.
|
|
|
|
.. seealso:: :py:class:`QgsMapLayerComboBox`
|
|
|
|
.. versionadded:: 2.3
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsfieldcombobox.h"
|
|
%End
|
|
public:
|
|
|
|
explicit QgsFieldComboBox( QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
QgsFieldComboBox creates a combo box to display the fields of a layer.
|
|
The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox.layerChanged to the slot setLayer.
|
|
%End
|
|
|
|
void setFilters( QgsFieldProxyModel::Filters filters );
|
|
%Docstring
|
|
setFilters allows filtering according to the type of field
|
|
%End
|
|
|
|
QgsFieldProxyModel::Filters filters() const;
|
|
%Docstring
|
|
currently used filter on list of fields
|
|
%End
|
|
|
|
void setAllowEmptyFieldName( bool allowEmpty );
|
|
%Docstring
|
|
Sets whether an optional empty field ("not set") option is shown in the combo box.
|
|
|
|
.. seealso:: :py:func:`allowEmptyFieldName`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
bool allowEmptyFieldName() const;
|
|
%Docstring
|
|
Returns ``True`` if the combo box allows the empty field ("not set") choice.
|
|
|
|
.. seealso:: :py:func:`setAllowEmptyFieldName`
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
QString currentField() const;
|
|
%Docstring
|
|
Returns the currently selected field
|
|
%End
|
|
|
|
QgsVectorLayer *layer() const;
|
|
%Docstring
|
|
Returns the layer currently associated with the combobox.
|
|
|
|
.. seealso:: :py:func:`setLayer`
|
|
%End
|
|
|
|
void setFields( const QgsFields &fields );
|
|
%Docstring
|
|
Manually sets the ``fields`` to use for the combo box.
|
|
|
|
This method should only be used when the combo box ISN'T associated with a layer()
|
|
and needs to show the fields from an arbitrary field collection instead. Calling
|
|
setFields() will automatically clear any existing layer().
|
|
|
|
.. seealso:: :py:func:`fields`
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
QgsFields fields() const;
|
|
%Docstring
|
|
Returns the fields currently shown in the combobox.
|
|
|
|
This will either be fields from the associated layer() or the fields
|
|
manually set by a call to setFields().
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
signals:
|
|
void fieldChanged( const QString &fieldName );
|
|
%Docstring
|
|
Emitted when the currently selected field changes.
|
|
%End
|
|
|
|
public slots:
|
|
|
|
void setLayer( QgsMapLayer *layer );
|
|
%Docstring
|
|
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.
|
|
|
|
.. seealso:: :py:func:`layer`
|
|
%End
|
|
|
|
void setField( const QString &fieldName );
|
|
%Docstring
|
|
setField sets the currently selected field
|
|
%End
|
|
|
|
protected slots:
|
|
void indexChanged( int i );
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgsfieldcombobox.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|