4#ifndef QSQLTABLEMODEL_H
5#define QSQLTABLEMODEL_H
7#include <QtSql/qtsqlglobal.h>
8#include <QtSql/qsqldatabase.h>
9#include <QtSql/qsqlquerymodel.h>
33 virtual void setTable(
const QString &tableName);
49 void clear()
override;
51 virtual void setEditStrategy(EditStrategy strategy);
52 EditStrategy editStrategy()
const;
56 int fieldIndex(
const QString &fieldName)
const;
73 virtual void revertRow(
int row);
77 virtual bool selectRow(
int row);
97 virtual bool deleteRowFromTable(
int row);
98 virtual QString orderByClause()
const;
99 virtual QString selectStatement()
const;
102#if QT_SQL_REMOVED_SINCE(6, 5)
virtual bool clearItemData(const QModelIndex &index)
virtual void revert()
Lets the model know that it should discard cached information.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual bool submit()
Lets the model know that it should submit cached information to permanent storage.
The QSqlDatabase class handles a connection to a database.
The QSqlField class manipulates the fields in SQL database tables and views.
The QSqlIndex class provides functions to manipulate and describe database indexes.
The QSqlQueryModel class provides a read-only data model for SQL result sets.
virtual QModelIndex indexInQuery(const QModelIndex &item) const
Returns the index of the value in the database result set for the given item in the model.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void setQuery(QSqlQuery &&query)
Resets the model and sets the data provider to be the given query.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the header data for the given role in the section of the header with the specified orientatio...
QSqlRecord record() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void clear()
Clears the model and releases any acquired resource.
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
Removes count columns from the model starting from position column.
The QSqlQuery class provides a means of executing and manipulating SQL statements.
The QSqlRecord class encapsulates a database record.
The QSqlTableModel class provides an editable data model for a single database table.
EditStrategy
This enum type describes which strategy to choose when editing values in the database.
void primeInsert(int row, QSqlRecord &record)
This signal is emitted by insertRows(), when an insertion is initiated in the given row of the curren...
void beforeInsert(QSqlRecord &record)
This signal is emitted by insertRowIntoTable() before a new row is inserted into the currently active...
void beforeDelete(int row)
This signal is emitted by deleteRowFromTable() before the row is deleted from the currently active da...
void beforeUpdate(int row, QSqlRecord &record)
This signal is emitted by updateRowInTable() before the row is updated in the currently active databa...
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLsizei GLsizei GLint * values
[15]
GLenum GLenum GLsizei count
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
#define QT_REQUIRE_CONFIG(feature)
selection select(topLeft, bottomRight)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent