QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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 22 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 330 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 335 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::editable | ( | ) | const |
Returns true if the Raster Attribute Table is editable.
Definition at line 28 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 507 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::hasColor | ( | ) | const |
Returns true
if the Raster Attribute Table has color information.
Definition at line 38 of file qgsrasterattributetablemodel.cpp.
bool QgsRasterAttributeTableModel::hasRamp | ( | ) | const |
Returns true
if the Raster Attribute Table has ramp information.
Definition at line 43 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 482 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 48 of file qgsrasterattributetablemodel.cpp.
QString QgsRasterAttributeTableModel::headerTooltip | ( | const int | section | ) | const |
Returns the tooltip for the given section.
Definition at line 67 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 231 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 120 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 145 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 253 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 209 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 115 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 102 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 174 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 151 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 275 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 325 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 415 of file qgsrasterattributetablemodel.cpp.
void QgsRasterAttributeTableModel::setEditable | ( | bool | editable | ) |
Sets the Raster Attribute Table editable state to editable.
Definition at line 33 of file qgsrasterattributetablemodel.cpp.