QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
The QgsRasterAttributeTableModel class manages a QgsRasterAttributeTable. More...
#include <qgsrasterattributetablemodel.h>
Public Member Functions | |
QgsRasterAttributeTableModel (QgsRasterAttributeTable *rat, QObject *parent=nullptr) | |
Creates a new QgsRasterAttributeTableModel from raster attribute table rat and optional parent. | |
int | columnCount (const QModelIndex &parent) const override |
QVariant | data (const QModelIndex &index, int role) const override |
bool | editable () const |
Returns true if the Raster Attribute Table is editable. | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | hasColor () const |
Returns true if the Raster Attribute Table has color information. | |
bool | hasRamp () const |
Returns true if the Raster Attribute Table has ramp information. | |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
QStringList | headerNames () const |
Returns all the header names, including the "virtual" color header if the Raster Attribute Table has color or ramp. | |
QString | headerTooltip (const int section) const |
Returns the tooltip for the given section. | |
bool | insertColor (int position, QString *errorMessage=nullptr) |
Create RGBA fields and inserts them at position, optionally reporting any error in errorMessage, returns true on success. | |
bool | insertField (const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QMetaType::Type type, QString *errorMessage=nullptr) |
Inserts a field at the given position. | |
Q_DECL_DEPRECATED bool | insertField (const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage=nullptr) |
Inserts a field at the given position. | |
bool | insertRamp (int position, QString *errorMessage=nullptr) |
Create RGBA minimum and maximum fields and inserts them at position, optionally reporting any error in errorMessage, returns true on success. | |
bool | insertRow (const int position, const QVariantList &rowData, QString *errorMessage=nullptr) |
Inserts a new row before position, optionally reporting any error in errorMessage, returns true on success. | |
bool | isDirty () |
Returns true if the Raster Attribute Table was modified since it was last saved or read. | |
bool | isValid (QString *errorMessage=nullptr) |
Checks if the Raster Attribute Table is valid, optionally returns validation errors in errorMessage. | |
bool | removeColorOrRamp (QString *errorMessage=nullptr) |
Removes all color or ramp information, optionally reporting any error in errorMessage, returns true on success. | |
bool | removeField (const int position, QString *errorMessage=nullptr) |
Remove the field at given position, optionally reporting any error in errorMessage, returns true on success. | |
bool | removeRow (const int position, QString *errorMessage=nullptr) |
Removes the row at position, optionally reporting any error in errorMessage, returns true on success. | |
int | rowCount (const QModelIndex &parent) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setEditable (bool editable) |
Sets the Raster Attribute Table editable state to editable. | |
The QgsRasterAttributeTableModel class manages a QgsRasterAttributeTable.
Definition at line 31 of file qgsrasterattributetablemodel.h.
|
explicit |
Creates a new QgsRasterAttributeTableModel from raster attribute table rat and optional parent.
Definition at line 21 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 329 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 334 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::editable | ( | ) | const |
Returns true if the Raster Attribute Table is editable.
Definition at line 27 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 506 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::hasColor | ( | ) | const |
Returns true
if the Raster Attribute Table has color information.
Definition at line 37 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::hasRamp | ( | ) | const |
Returns true
if the Raster Attribute Table has ramp information.
Definition at line 42 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 481 of file qgsrasterattributetablemodel.cpp.
QStringList QgsRasterAttributeTableModel::headerNames | ( | ) | const |
Returns all the header names, including the "virtual" color header if the Raster Attribute Table has color or ramp.
Definition at line 47 of file qgsrasterattributetablemodel.cpp.
QString QgsRasterAttributeTableModel::headerTooltip | ( | const int | section | ) | const |
Returns the tooltip for the given section.
Definition at line 66 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::insertColor | ( | int | position, |
QString * | errorMessage = nullptr |
||
) |
Create RGBA fields and inserts them at position, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 230 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::insertField | ( | const int | position, |
const QString & | name, | ||
const Qgis::RasterAttributeTableFieldUsage | usage, | ||
const QMetaType::Type | type, | ||
QString * | errorMessage = nullptr |
||
) |
Inserts a field at the given position.
name | field name |
usage | field usage |
type | field type |
position | insertion point (before) |
errorMessage | optional error message |
Definition at line 119 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::insertField | ( | const int | position, |
const QString & | name, | ||
const Qgis::RasterAttributeTableFieldUsage | usage, | ||
const QVariant::Type | type, | ||
QString * | errorMessage = nullptr |
||
) |
Inserts a field at the given position.
name | field name |
usage | field usage |
type | field type |
position | insertion point (before) |
errorMessage | optional error message |
Definition at line 144 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::insertRamp | ( | int | position, |
QString * | errorMessage = nullptr |
||
) |
Create RGBA minimum and maximum fields and inserts them at position, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 252 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::insertRow | ( | const int | position, |
const QVariantList & | rowData, | ||
QString * | errorMessage = nullptr |
||
) |
Inserts a new row before position, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 208 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::isDirty | ( | ) |
Returns true
if the Raster Attribute Table was modified since it was last saved or read.
Definition at line 114 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::isValid | ( | QString * | errorMessage = nullptr | ) |
Checks if the Raster Attribute Table is valid, optionally returns validation errors in errorMessage.
Definition at line 101 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::removeColorOrRamp | ( | QString * | errorMessage = nullptr | ) |
Removes all color or ramp information, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 173 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::removeField | ( | const int | position, |
QString * | errorMessage = nullptr |
||
) |
Remove the field at given position, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 150 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::removeRow | ( | const int | position, |
QString * | errorMessage = nullptr |
||
) |
Removes the row at position, optionally reporting any error in errorMessage, returns true
on success.
Definition at line 274 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 324 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 414 of file qgsrasterattributetablemodel.cpp.
void QgsRasterAttributeTableModel::setEditable | ( | bool | editable | ) |
Sets the Raster Attribute Table editable state to editable.
Definition at line 32 of file qgsrasterattributetablemodel.cpp.