A list model storing a list of FieldDescription objects in a TableDescription. More...
Header: | #include <FieldDescriptionListModel.h> |
Since: | Esri::ArcGISRuntime 100.14 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | FieldDescriptionRoles { FieldDescriptionAliasRole, FieldDescriptionDomainNameRole, FieldDescriptionEditableRole, FieldDescriptionFieldTypeRole, FieldDescriptionLengthRole, …, FieldDescriptionNullableRole } |
Public Functions
virtual | ~FieldDescriptionListModel() override |
void | append(Esri::ArcGISRuntime::FieldDescription *fieldDescription) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::FieldDescription *fieldDescription) const |
Esri::ArcGISRuntime::FieldDescription * | first() const |
int | indexOf(Esri::ArcGISRuntime::FieldDescription *fieldDescription) const |
void | insert(int index, Esri::ArcGISRuntime::FieldDescription *fieldDescription) |
bool | isEmpty() const |
Esri::ArcGISRuntime::FieldDescription * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::FieldDescription *fieldDescription) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::FieldDescription * | at(int index) const override |
virtual int | size() const override |
Signals
void | errorOccurred(const Esri::ArcGISRuntime::Error &error) |
void | itemAdded(int index) |
void | itemRemoved(int index) |
Detailed Description
Modifying this model (adding, removing, moving) will update the FieldDescription's available in the TableDescription.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
alias | QString | The field's alias. |
domainName | QString | The name of the domain to use on this field. |
editable | bool | True if the field is editable. |
fieldType | FieldType | The field's data type. |
length | int | The length of the field. |
name | QString | The field's name. |
nullable | bool | True if the field is nullable. |
Member Type Documentation
enum FieldDescriptionListModel::FieldDescriptionRoles
This enum specifies the custom roles which can be used with FieldDescriptionListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionAliasRole | Qt::UserRole + 1 | The field's alias. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionDomainNameRole | Qt::UserRole + 2 | The name of the domain to use on this field. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionEditableRole | Qt::UserRole + 3 | true if the field is editable. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionFieldTypeRole | Qt::UserRole + 4 | The field's data type. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionLengthRole | Qt::UserRole + 5 | The length of the field. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionNameRole | Qt::UserRole + 6 | The field's name. |
Esri::ArcGISRuntime::FieldDescriptionListModel::FieldDescriptionNullableRole | Qt::UserRole + 7 | true if the field is nullable. |
Member Function Documentation
[override virtual]
FieldDescriptionListModel::~FieldDescriptionListModel ()
destructor
void FieldDescriptionListModel::append(Esri::ArcGISRuntime::FieldDescription *fieldDescription )
Appends a fieldDescription to the layer list model.
[override virtual]
Esri::ArcGISRuntime::FieldDescription *FieldDescriptionListModel::at(int index) const
Returns the FieldDescription at the specified index.
void FieldDescriptionListModel::clear()
Removes all FieldDescription from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
bool FieldDescriptionListModel::contains(Esri::ArcGISRuntime::FieldDescription *fieldDescription ) const
Returns true
if the list model contains the specified fieldDescription.
[signal]
void FieldDescriptionListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::FieldDescription *FieldDescriptionListModel::first() const
Returns the first FieldDescription in the list model.
int FieldDescriptionListModel::indexOf (Esri::ArcGISRuntime::FieldDescription *fieldDescription ) const
Returns the index of the fieldDescription specified.
void FieldDescriptionListModel::insert(int index, Esri::ArcGISRuntime::FieldDescription *fieldDescription )
Inserts a fieldDescription at a specified index in the list model.
This method will append to the list if the index is greater than the current size of the list model.
bool FieldDescriptionListModel::isEmpty () const
Returns true
if the list model contains no field description.
[signal, since Esri::ArcGISRuntime 100.15]
void FieldDescriptionListModel::itemAdded (int index)
Signal emitted when an item is added to the list model.
- index is the index of the added field description.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal, since Esri::ArcGISRuntime 100.15]
void FieldDescriptionListModel::itemRemoved (int index)
Signal emitted when an item is removed from the list model.
- index is the index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
Esri::ArcGISRuntime::FieldDescription *FieldDescriptionListModel::last() const
Returns the last FieldDescription in the list model.
void FieldDescriptionListModel::move(int from, int to)
Moves one FieldDescription from an index in the list model to a different index.
void FieldDescriptionListModel::removeAt (int index)
Removes a FieldDescription at the specified index.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
void FieldDescriptionListModel::removeOne (Esri::ArcGISRuntime::FieldDescription *fieldDescription )
Removes the specified fieldDescription from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
[override virtual]
int FieldDescriptionListModel::size() const
Returns the number of FieldDescription contained in the list model.