- All Implemented Interfaces:
QtObjectInterface
,QtSignalBlockerInterface
,QtSignalEmitterInterface
,QtThreadAffineInterface
- Direct Known Subclasses:
QSqlRelationalTableModel
public class QSqlTableModel extends QSqlQueryModel
Editable data model for a single database table
Java wrapper for Qt class QSqlTableModel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QSqlTableModel.EditStrategy
Java wrapper for Qt enum QSqlTableModel::EditStrategyNested classes/interfaces inherited from class io.qt.core.QAbstractItemModel
QAbstractItemModel.CheckIndexOption, QAbstractItemModel.CheckIndexOptions, QAbstractItemModel.LayoutChangeHint
Nested classes/interfaces inherited from class io.qt.core.QObject
QObject.MultiSignal, QObject.PrivateSignal0, QObject.PrivateSignal1<A>, QObject.PrivateSignal2<A,B>, QObject.PrivateSignal3<A,B,C>, QObject.PrivateSignal4<A,B,C,D>, QObject.PrivateSignal5<A,B,C,D,E>, QObject.PrivateSignal6<A,B,C,D,E,F>, QObject.PrivateSignal7<A,B,C,D,E,F,G>, QObject.PrivateSignal8<A,B,C,D,E,F,G,H>, QObject.PrivateSignal9<A,B,C,D,E,F,G,H,I>, QObject.QBooleanProperty, QObject.QByteProperty, QObject.QCharProperty, QObject.QComputedBooleanProperty, QObject.QComputedByteProperty, QObject.QComputedCharProperty, QObject.QComputedDoubleProperty, QObject.QComputedFloatProperty, QObject.QComputedIntProperty, QObject.QComputedLongProperty, QObject.QComputedProperty<T>, QObject.QComputedShortProperty, QObject.QDeclarativeConstructor, QObject.QDoubleProperty, QObject.QFloatProperty, QObject.QIntProperty, QObject.QLongProperty, QObject.QProperty<T>, QObject.QShortProperty, QObject.Signal0, QObject.Signal1<A>, QObject.Signal1Default1<A>, QObject.Signal2<A,B>, QObject.Signal2Default1<A,B>, QObject.Signal2Default2<A,B>, QObject.Signal3<A,B,C>, QObject.Signal3Default1<A,B,C>, QObject.Signal3Default2<A,B,C>, QObject.Signal3Default3<A,B,C>, QObject.Signal4<A,B,C,D>, QObject.Signal4Default1<A,B,C,D>, QObject.Signal4Default2<A,B,C,D>, QObject.Signal4Default3<A,B,C,D>, QObject.Signal4Default4<A,B,C,D>, QObject.Signal5<A,B,C,D,E>, QObject.Signal5Default1<A,B,C,D,E>, QObject.Signal5Default2<A,B,C,D,E>, QObject.Signal5Default3<A,B,C,D,E>, QObject.Signal5Default4<A,B,C,D,E>, QObject.Signal5Default5<A,B,C,D,E>, QObject.Signal6<A,B,C,D,E,F>, QObject.Signal6Default1<A,B,C,D,E,F>, QObject.Signal6Default2<A,B,C,D,E,F>, QObject.Signal6Default3<A,B,C,D,E,F>, QObject.Signal6Default4<A,B,C,D,E,F>, QObject.Signal6Default5<A,B,C,D,E,F>, QObject.Signal6Default6<A,B,C,D,E,F>, QObject.Signal7<A,B,C,D,E,F,G>, QObject.Signal7Default1<A,B,C,D,E,F,G>, QObject.Signal7Default2<A,B,C,D,E,F,G>, QObject.Signal7Default3<A,B,C,D,E,F,G>, QObject.Signal7Default4<A,B,C,D,E,F,G>, QObject.Signal7Default5<A,B,C,D,E,F,G>, QObject.Signal7Default6<A,B,C,D,E,F,G>, QObject.Signal7Default7<A,B,C,D,E,F,G>, QObject.Signal8<A,B,C,D,E,F,G,H>, QObject.Signal8Default1<A,B,C,D,E,F,G,H>, QObject.Signal8Default2<A,B,C,D,E,F,G,H>, QObject.Signal8Default3<A,B,C,D,E,F,G,H>, QObject.Signal8Default4<A,B,C,D,E,F,G,H>, QObject.Signal8Default5<A,B,C,D,E,F,G,H>, QObject.Signal8Default6<A,B,C,D,E,F,G,H>, QObject.Signal8Default7<A,B,C,D,E,F,G,H>, QObject.Signal8Default8<A,B,C,D,E,F,G,H>, QObject.Signal9<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default1<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default2<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default3<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default4<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default5<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default6<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default7<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default8<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default9<A,B,C,D,E,F,G,H,I>, QObject.SignalConfiguration
-
Field Summary
Fields Modifier and Type Field Description QObject.Signal1<@QtPrimitiveType Integer>
beforeDelete
QObject.Signal1<QSqlRecord>
beforeInsert
QObject.Signal2<@QtPrimitiveType Integer,QSqlRecord>
beforeUpdate
QObject.Signal2<@QtPrimitiveType Integer,QSqlRecord>
primeInsert
static QMetaObject
staticMetaObject
This variable stores the meta-object for the class.Fields inherited from class io.qt.core.QAbstractItemModel
columnsAboutToBeInserted, columnsAboutToBeMoved, columnsAboutToBeRemoved, columnsInserted, columnsMoved, columnsRemoved, dataChanged, headerDataChanged, layoutAboutToBeChanged, layoutChanged, modelAboutToBeReset, modelReset, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved
-
Constructor Summary
Constructors Modifier Constructor Description QSqlTableModel()
Overloaded constructor forQSqlTableModel(io.qt.core.QObject, io.qt.sql.QSqlDatabase)
QSqlTableModel(QObject parent)
Overloaded constructor forQSqlTableModel(io.qt.core.QObject, io.qt.sql.QSqlDatabase)
withdb = new io.qt.sql.QSqlDatabase()
.protected
QSqlTableModel(QObject.QDeclarativeConstructor constructor)
Constructor for internal use only.QSqlTableModel(QObject parent, QSqlDatabase db)
protected
QSqlTableModel(QtObject.QPrivateConstructor p)
Constructor for internal use only. -
Method Summary
Modifier and Type Method Description void
clear()
boolean
clearItemData(QModelIndex index)
Object
data(QModelIndex idx, int role)
QSqlDatabase
database()
protected boolean
deleteRowFromTable(int row)
QSqlTableModel.EditStrategy
editStrategy()
int
fieldIndex(String fieldName)
String
filter()
Qt.ItemFlags
flags(QModelIndex index)
Object
headerData(int section, Qt.Orientation orientation, int role)
protected QModelIndex
indexInQuery(QModelIndex item)
boolean
insertRecord(int row, QSqlRecord record)
protected boolean
insertRowIntoTable(QSqlRecord values)
boolean
insertRows(int row, int count, QModelIndex parent)
boolean
isDirty()
boolean
isDirty(QModelIndex index)
protected String
orderByClause()
QSqlIndex
primaryKey()
protected QSqlRecord
primaryValues(int row)
QSqlRecord
record()
QSqlRecord
record(int row)
boolean
removeColumns(int column, int count, QModelIndex parent)
boolean
removeRows(int row, int count, QModelIndex parent)
void
revert()
void
revertAll()
void
revertRow(int row)
int
rowCount(QModelIndex parent)
boolean
select()
boolean
selectRow(int row)
protected String
selectStatement()
boolean
setData(QModelIndex index, Object value, int role)
void
setEditStrategy(QSqlTableModel.EditStrategy strategy)
void
setFilter(String filter)
protected void
setPrimaryKey(QSqlIndex key)
void
setQuery(QSqlQuery query)
boolean
setRecord(int row, QSqlRecord record)
void
setSort(int column, Qt.SortOrder order)
void
setTable(String tableName)
void
sort(int column, Qt.SortOrder order)
boolean
submit()
boolean
submitAll()
String
tableName()
protected boolean
updateRowInTable(int row, QSqlRecord values)
Methods inherited from class io.qt.sql.QSqlQueryModel
beginInsertColumns, beginInsertRows, beginRemoveColumns, beginRemoveRows, beginResetModel, canFetchMore, columnCount, endInsertColumns, endInsertRows, endRemoveColumns, endRemoveRows, endResetModel, fetchMore, insertColumns, lastError, query, queryChange, roleNames, setHeaderData, setLastError, setQuery, setQuery
Methods inherited from class io.qt.core.QAbstractTableModel
dropMimeData, hasChildren, index, parent, sibling
Methods inherited from class io.qt.core.QAbstractItemModel
beginMoveColumns, beginMoveRows, buddy, canDropMimeData, changePersistentIndex, changePersistentIndexList, checkIndex, checkIndex, checkIndex, columnCount, createIndex, createIndex, data, data, data, decodeData, encodeData, endMoveColumns, endMoveRows, hasChildren, hasIndex, hasIndex, headerData, index, insertColumn, insertColumn, insertColumns, insertRow, insertRow, insertRows, itemData, match, match, match, match, mimeData, mimeTypes, moveColumn, moveColumns, moveRow, moveRows, multiData, persistentIndexList, removeColumn, removeColumn, removeColumns, removeRow, removeRow, removeRows, resetInternalData, rowCount, setData, setData, setData, setHeaderData, setItemData, sort, span, supportedDragActions, supportedDropActions
Methods inherited from class io.qt.core.QObject
blockSignals, childEvent, children, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connectNotify, customEvent, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnectNotify, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, event, eventFilter, findChild, findChild, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, inherits, inherits, installEventFilter, isSignalConnected, isWidgetType, isWindowType, killTimer, metaObject, moveToThread, objectName, parent, property, qt_metacast, receivers, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, startTimer, thread, timerEvent, toString, tr, tr, tr
-
Field Details
-
staticMetaObject
This variable stores the meta-object for the class. -
beforeDelete
-
beforeInsert
-
beforeUpdate
-
primeInsert
-
-
Constructor Details
-
QSqlTableModel
Overloaded constructor for
QSqlTableModel(io.qt.core.QObject, io.qt.sql.QSqlDatabase)
withdb = new io.qt.sql.QSqlDatabase()
. -
QSqlTableModel
public QSqlTableModel()Overloaded constructor for
QSqlTableModel(io.qt.core.QObject, io.qt.sql.QSqlDatabase)
with:
parent = null
db = new io.qt.sql.QSqlDatabase()
-
QSqlTableModel
-
QSqlTableModel
Constructor for internal use only.- Parameters:
p
- expected to benull
.
-
QSqlTableModel
Constructor for internal use only. It is not allowed to call the declarative constructor from inside Java.
-
-
Method Details
-
database
-
editStrategy
-
fieldIndex
-
filter
-
insertRecord
-
isDirty
-
isDirty
-
primaryKey
-
primaryValues
-
record
- Overrides:
record
in classQSqlQueryModel
-
record
- Overrides:
record
in classQSqlQueryModel
-
revertAll
public final void revertAll() -
setPrimaryKey
-
setQuery
- Overrides:
setQuery
in classQSqlQueryModel
-
setRecord
-
submitAll
public final boolean submitAll() -
tableName
-
clear
- Overrides:
clear
in classQSqlQueryModel
-
clearItemData
- Overrides:
clearItemData
in classQAbstractItemModel
-
data
- Overrides:
data
in classQSqlQueryModel
-
deleteRowFromTable
-
flags
- Overrides:
flags
in classQAbstractTableModel
-
headerData
- Overrides:
headerData
in classQSqlQueryModel
-
indexInQuery
- Overrides:
indexInQuery
in classQSqlQueryModel
-
insertRowIntoTable
-
insertRows
- Overrides:
insertRows
in classQAbstractItemModel
-
orderByClause
-
removeColumns
- Overrides:
removeColumns
in classQSqlQueryModel
-
removeRows
- Overrides:
removeRows
in classQAbstractItemModel
-
revert
public void revert()- Overrides:
revert
in classQAbstractItemModel
-
revertRow
-
rowCount
- Overrides:
rowCount
in classQSqlQueryModel
-
select
public boolean select() -
selectRow
public boolean selectRow(int row) -
selectStatement
-
setData
- Overrides:
setData
in classQAbstractItemModel
-
setEditStrategy
-
setFilter
-
setSort
-
setTable
-
sort
- Overrides:
sort
in classQAbstractItemModel
-
submit
public boolean submit()- Overrides:
submit
in classQAbstractItemModel
-
updateRowInTable
-