QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
|
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. More... | |
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. More... | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | hasColor () const |
Returns true if the Raster Attribute Table has color information. More... | |
bool | hasRamp () const |
Returns true if the Raster Attribute Table has ramp information. More... | |
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. More... | |
QString | headerTooltip (const int section) const |
Returns the tooltip for the given section. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | isDirty () |
Returns true if the Raster Attribute Table was modified since it was last saved or read. More... | |
bool | isValid (QString *errorMessage=nullptr) |
Checks if the Raster Attribute Table is valid, optionally returns validation errors in errorMessage. More... | |
bool | removeColorOrRamp (QString *errorMessage=nullptr) |
Removes all color or ramp information, optionally reporting any error in errorMessage, returns true on success. More... | |
bool | removeField (const int position, QString *errorMessage=nullptr) |
Remove the field at given position, optionally reporting any error in errorMessage, returns true on success. More... | |
bool | removeRow (const int position, QString *errorMessage=nullptr) |
Removes the row at position, optionally reporting any error in errorMessage, returns true on success. More... | |
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. More... | |
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 323 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 328 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 500 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 475 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 224 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 119 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 246 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 202 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 167 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 144 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 268 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 318 of file qgsrasterattributetablemodel.cpp.
|
override |
Definition at line 408 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.