API reference - Class QSqlTableModel

Notation used in Ruby API documentation

Description: Binding of QSqlTableModel

Class hierarchy: QSqlTableModel » QSqlQueryModel » QAbstractTableModel » QAbstractItemModel » QObject

Public constructors

new QSqlTableModelnew(QObject ptr parent = 0,
QSqlDatabase db = QSqlDatabase())
Constructor QSqlTableModel::QSqlTableModel(QObject *parent, QSqlDatabase db)

Public methods

voidclearMethod void QSqlTableModel::clear()
voidcreateEnsures the C++ object is created
[const]QVariantdata(const QModelIndex idx,
int role = Qt::DisplayRole)
Method QVariant QSqlTableModel::data(const QModelIndex &idx, int role)
[const]QSqlDatabasedatabaseMethod QSqlDatabase QSqlTableModel::database()
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]QSqlTableModel_EditStrategyeditStrategyMethod QSqlTableModel::EditStrategy QSqlTableModel::editStrategy()
voideditStrategy=(const QSqlTableModel_EditStrategy strategy)Method void QSqlTableModel::setEditStrategy(QSqlTableModel::EditStrategy strategy)
[const]intfieldIndex(string fieldName)Method int QSqlTableModel::fieldIndex(const QString &fieldName)
[const]stringfilterMethod QString QSqlTableModel::filter()
voidfilter=(string filter)Method void QSqlTableModel::setFilter(const QString &filter)
[const]Qt_QFlags_ItemFlagflags(const QModelIndex index)Method QFlags<Qt::ItemFlag> QSqlTableModel::flags(const QModelIndex &index)
[const]QVariantheaderData(int section,
const Qt_Orientation orientation,
int role = Qt::DisplayRole)
Method QVariant QSqlTableModel::headerData(int section, Qt::Orientation orientation, int role)
boolinsertRecord(int row,
const QSqlRecord record)
Method bool QSqlTableModel::insertRecord(int row, const QSqlRecord &record)
boolinsertRows(int row,
int count,
const QModelIndex parent = QModelIndex())
Method bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent)
[const]boolisDirty(const QModelIndex index)Method bool QSqlTableModel::isDirty(const QModelIndex &index)
[const]boolisDirty?(const QModelIndex index)Method bool QSqlTableModel::isDirty(const QModelIndex &index)
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[const]QSqlIndexprimaryKeyMethod QSqlIndex QSqlTableModel::primaryKey()
boolremoveColumns(int column,
int count,
const QModelIndex parent = QModelIndex())
Method bool QSqlTableModel::removeColumns(int column, int count, const QModelIndex &parent)
boolremoveRows(int row,
int count,
const QModelIndex parent = QModelIndex())
Method bool QSqlTableModel::removeRows(int row, int count, const QModelIndex &parent)
voidrevertMethod void QSqlTableModel::revert()
voidrevertAllMethod void QSqlTableModel::revertAll()
voidrevertRow(int row)Method void QSqlTableModel::revertRow(int row)
[const]introwCount(const QModelIndex parent = QModelIndex())Method int QSqlTableModel::rowCount(const QModelIndex &parent)
boolselectMethod bool QSqlTableModel::select()
boolsetData(const QModelIndex index,
const QVariant value,
int role = Qt::EditRole)
Method bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
voidsetEditStrategy(const QSqlTableModel_EditStrategy strategy)Method void QSqlTableModel::setEditStrategy(QSqlTableModel::EditStrategy strategy)
voidsetFilter(string filter)Method void QSqlTableModel::setFilter(const QString &filter)
boolsetRecord(int row,
const QSqlRecord record)
Method bool QSqlTableModel::setRecord(int row, const QSqlRecord &record)
voidsetSort(int column,
const Qt_SortOrder order)
Method void QSqlTableModel::setSort(int column, Qt::SortOrder order)
voidsetTable(string tableName)Method void QSqlTableModel::setTable(const QString &tableName)
voidsort(int column,
const Qt_SortOrder order)
Method void QSqlTableModel::sort(int column, Qt::SortOrder order)
boolsubmitMethod bool QSqlTableModel::submit()
boolsubmitAllMethod bool QSqlTableModel::submitAll()
[const]stringtableNameMethod QString QSqlTableModel::tableName()

Public static methods and constants

QSqlTableModel_EditStrategyOnFieldChangeEnum constant QSqlTableModel::OnFieldChange
QSqlTableModel_EditStrategyOnManualSubmitEnum constant QSqlTableModel::OnManualSubmit
QSqlTableModel_EditStrategyOnRowChangeEnum constant QSqlTableModel::OnRowChange
QMetaObjectstaticMetaObjectObtains the static MetaObject for this class.
stringtr(string s,
string c = 0)
Static method QString QSqlTableModel::tr(const char *s, const char *c)
stringtr(string s,
string c,
int n)
Static method QString QSqlTableModel::tr(const char *s, const char *c, int n)
stringtrUtf8(string s,
string c = 0)
Static method QString QSqlTableModel::trUtf8(const char *s, const char *c)
stringtrUtf8(string s,
string c,
int n)
Static method QString QSqlTableModel::trUtf8(const char *s, const char *c, int n)

Detailed description

[static] QSqlTableModel_EditStrategy OnFieldChange

Description: Enum constant QSqlTableModel::OnFieldChange

[static] QSqlTableModel_EditStrategy OnManualSubmit

Description: Enum constant QSqlTableModel::OnManualSubmit

[static] QSqlTableModel_EditStrategy OnRowChange

Description: Enum constant QSqlTableModel::OnRowChange

void clear

Description: Method void QSqlTableModel::clear()

This is a reimplementation of QSqlQueryModel::clear

void create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

[const] QVariant data(const QModelIndex idx,int role = Qt::DisplayRole)

Description: Method QVariant QSqlTableModel::data(const QModelIndex &idx, int role)

This is a reimplementation of QSqlQueryModel::data

[const] QSqlDatabase database

Description: Method QSqlDatabase QSqlTableModel::database()

void destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] QSqlTableModel_EditStrategy editStrategy

Description: Method QSqlTableModel::EditStrategy QSqlTableModel::editStrategy()

void editStrategy=(const QSqlTableModel_EditStrategy strategy)

Description: Method void QSqlTableModel::setEditStrategy(QSqlTableModel::EditStrategy strategy)

[const] int fieldIndex(string fieldName)

Description: Method int QSqlTableModel::fieldIndex(const QString &fieldName)

[const] string filter

Description: Method QString QSqlTableModel::filter()

void filter=(string filter)

Description: Method void QSqlTableModel::setFilter(const QString &filter)

[const] Qt_QFlags_ItemFlag flags(const QModelIndex index)

Description: Method QFlags<Qt::ItemFlag> QSqlTableModel::flags(const QModelIndex &index)

This is a reimplementation of QAbstractItemModel::flags

[const] QVariant headerData(int section,const Qt_Orientation orientation,int role = Qt::DisplayRole)

Description: Method QVariant QSqlTableModel::headerData(int section, Qt::Orientation orientation, int role)

This is a reimplementation of QSqlQueryModel::headerData

bool insertRecord(int row,const QSqlRecord record)

Description: Method bool QSqlTableModel::insertRecord(int row, const QSqlRecord &record)

bool insertRows(int row,int count,const QModelIndex parent = QModelIndex())

Description: Method bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent)

This is a reimplementation of QAbstractItemModel::insertRows

[const] bool isDirty(const QModelIndex index)

Description: Method bool QSqlTableModel::isDirty(const QModelIndex &index)

[const] bool isDirty?(const QModelIndex index)

Description: Method bool QSqlTableModel::isDirty(const QModelIndex &index)

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

[static] new QSqlTableModel new(QObject ptr parent = 0,QSqlDatabase db = QSqlDatabase())

Description: Constructor QSqlTableModel::QSqlTableModel(QObject *parent, QSqlDatabase db)

This method creates an object of class QSqlTableModel.

[const] QSqlIndex primaryKey

Description: Method QSqlIndex QSqlTableModel::primaryKey()

bool removeColumns(int column,int count,const QModelIndex parent = QModelIndex())

Description: Method bool QSqlTableModel::removeColumns(int column, int count, const QModelIndex &parent)

This is a reimplementation of QSqlQueryModel::removeColumns

bool removeRows(int row,int count,const QModelIndex parent = QModelIndex())

Description: Method bool QSqlTableModel::removeRows(int row, int count, const QModelIndex &parent)

This is a reimplementation of QAbstractItemModel::removeRows

void revert

Description: Method void QSqlTableModel::revert()

This is a reimplementation of QAbstractItemModel::revert

void revertAll

Description: Method void QSqlTableModel::revertAll()

void revertRow(int row)

Description: Method void QSqlTableModel::revertRow(int row)

[const] int rowCount(const QModelIndex parent = QModelIndex())

Description: Method int QSqlTableModel::rowCount(const QModelIndex &parent)

This is a reimplementation of QSqlQueryModel::rowCount

bool select

Description: Method bool QSqlTableModel::select()

bool setData(const QModelIndex index,const QVariant value,int role = Qt::EditRole)

Description: Method bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role)

This is a reimplementation of QAbstractItemModel::setData

void setEditStrategy(const QSqlTableModel_EditStrategy strategy)

Description: Method void QSqlTableModel::setEditStrategy(QSqlTableModel::EditStrategy strategy)

void setFilter(string filter)

Description: Method void QSqlTableModel::setFilter(const QString &filter)

bool setRecord(int row,const QSqlRecord record)

Description: Method bool QSqlTableModel::setRecord(int row, const QSqlRecord &record)

void setSort(int column,const Qt_SortOrder order)

Description: Method void QSqlTableModel::setSort(int column, Qt::SortOrder order)

void setTable(string tableName)

Description: Method void QSqlTableModel::setTable(const QString &tableName)

void sort(int column,const Qt_SortOrder order)

Description: Method void QSqlTableModel::sort(int column, Qt::SortOrder order)

This is a reimplementation of QAbstractItemModel::sort

[static] QMetaObject staticMetaObject

Description: Obtains the static MetaObject for this class.

bool submit

Description: Method bool QSqlTableModel::submit()

This is a reimplementation of QAbstractItemModel::submit

bool submitAll

Description: Method bool QSqlTableModel::submitAll()

[const] string tableName

Description: Method QString QSqlTableModel::tableName()

[static] string tr(string s,string c = 0)

Description: Static method QString QSqlTableModel::tr(const char *s, const char *c)

This method is static and can be called without an instance.

[static] string tr(string s,string c,int n)

Description: Static method QString QSqlTableModel::tr(const char *s, const char *c, int n)

This method is static and can be called without an instance.

[static] string trUtf8(string s,string c = 0)

Description: Static method QString QSqlTableModel::trUtf8(const char *s, const char *c)

This method is static and can be called without an instance.

[static] string trUtf8(string s,string c,int n)

Description: Static method QString QSqlTableModel::trUtf8(const char *s, const char *c, int n)

This method is static and can be called without an instance.