1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldcombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFieldComboBox : QComboBox
{
%Docstring(signature="appended")
The :py:class:`QgsFieldComboBox` is a combo box which displays the list
of fields of a given layer. It might be combined with a
:py:class:`QgsMapLayerComboBox` to automatically update fields according
to a chosen layer. If expression must be used,
:py:class:`QgsFieldExpressionWidget` shall be used instead.
.. seealso:: :py:class:`QgsMapLayerComboBox`
%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 :py:class:`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`
%End
bool allowEmptyFieldName() const;
%Docstring
Returns ``True`` if the combo box allows the empty field ("not set")
choice.
.. seealso:: :py:func:`setAllowEmptyFieldName`
%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 :py:func:`~QgsFieldComboBox.layer` and needs to show the fields from
an arbitrary field collection instead. Calling
:py:func:`~QgsFieldComboBox.setFields` will automatically clear any
existing :py:func:`~QgsFieldComboBox.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
:py:func:`~QgsFieldComboBox.layer` or the fields manually set by a call
to :py:func:`~QgsFieldComboBox.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.py again *
************************************************************************/
|