#include <QtSql/QSqlRelationalTableModel>

More information will be added here shortly. For now, you'll find more extensive information about this class in the Qt reference for QSqlRelationalTableModel


Public Types Index

enum JoinMode

InnerJoin, LeftJoin

enum EditStrategy

OnFieldChange, OnRowChange, OnManualSubmit

Public Functions Index

QSqlRelationalTableModel (QObject *parent=0, QSqlDatabase db=QSqlDatabase())
virtual ~QSqlRelationalTableModel ()
virtual voidclear ()
virtual QVariantdata (const QModelIndex &item, int role=Qt::DisplayRole) const
QSqlRelationrelation (int column) const
virtual QSqlTableModel *relationModel (int column) const
virtual boolremoveColumns (int column, int count, const QModelIndex &parent=QModelIndex())
virtual boolselect ()
virtual boolsetData (const QModelIndex &item, const QVariant &value, int role=Qt::EditRole)
voidsetJoinMode (QSqlRelationalTableModel::JoinMode joinMode)
virtual voidsetRelation (int column, const QSqlRelation &relation)
virtual voidsetTable (const QString &tableName)
virtual QModelIndexbuddy (const QModelIndex &index) const Inherited
virtual boolcanFetchMore (const QModelIndex &parent=QModelIndex()) const Inherited
virtual intcolumnCount (const QModelIndex &parent=QModelIndex()) const Inherited
QSqlDatabasedatabase () const Inherited
virtual booldropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)Inherited
EditStrategyeditStrategy () const Inherited
virtual voidfetchMore (const QModelIndex &parent=QModelIndex())Inherited
intfieldIndex (const QString &fieldName) const Inherited
QStringfilter () const Inherited
virtual Qt::ItemFlagsflags (const QModelIndex &index) const Inherited
boolhasIndex (int row, int column, const QModelIndex &parent=QModelIndex()) const Inherited
virtual QVariantheaderData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const Inherited
virtual QModelIndexindex (int row, int column, const QModelIndex &parent=QModelIndex()) const Inherited
boolinsertColumn (int column, const QModelIndex &parent=QModelIndex())Inherited
virtual boolinsertColumns (int column, int count, const QModelIndex &parent=QModelIndex())Inherited
boolinsertRecord (int row, const QSqlRecord &record)Inherited
boolinsertRow (int row, const QModelIndex &parent=QModelIndex())Inherited
virtual boolinsertRows (int row, int count, const QModelIndex &parent=QModelIndex())Inherited
boolisDirty (const QModelIndex &index) const Inherited
virtual QMap< int, QVariant >itemData (const QModelIndex &index) const Inherited
QSqlErrorlastError () const Inherited
virtual QModelIndexListmatch (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const Inherited
virtual QMimeData *mimeData (const QModelIndexList &indexes) const Inherited
virtual QStringListmimeTypes () const Inherited
QSqlIndexprimaryKey () const Inherited
QAbstractItemModel (QObject *parent=0)Inherited
QAbstractTableModel (QObject *parent=0)Inherited
QSqlQueryModel (QObject *parent=0)Inherited
QSqlTableModel (QObject *parent=0, QSqlDatabase db=QSqlDatabase())Inherited
QSqlQueryquery () const Inherited
QSqlRecordrecord (int row) const Inherited
QSqlRecordrecord () const Inherited
boolremoveColumn (int column, const QModelIndex &parent=QModelIndex())Inherited
boolremoveRow (int row, const QModelIndex &parent=QModelIndex())Inherited
virtual boolremoveRows (int row, int count, const QModelIndex &parent=QModelIndex())Inherited
const QHash< int, QByteArray > &roleNames () const Inherited
virtual introwCount (const QModelIndex &parent=QModelIndex()) const Inherited
virtual voidsetEditStrategy (EditStrategy strategy)Inherited
virtual voidsetFilter (const QString &filter)Inherited
virtual boolsetHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)Inherited
virtual boolsetItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)Inherited
voidsetQuery (const QString &query, const QSqlDatabase &db=QSqlDatabase())Inherited
boolsetRecord (int row, const QSqlRecord &record)Inherited
virtual voidsetSort (int column, Qt::SortOrder order)Inherited
voidsetSupportedDragActions (Qt::DropActions)Inherited
QModelIndexsibling (int row, int column, const QModelIndex &idx) const Inherited
virtual voidsort (int column, Qt::SortOrder order)Inherited
virtual QSizespan (const QModelIndex &index) const Inherited
Qt::DropActionssupportedDragActions () const Inherited
virtual Qt::DropActionssupportedDropActions () const Inherited
QStringtableName () const Inherited

Protected Functions Index

virtual boolinsertRowIntoTable (const QSqlRecord &values)
virtual QStringorderByClause () const
virtual QStringselectStatement () const
virtual boolupdateRowInTable (int row, const QSqlRecord &values)
voidbeginInsertColumns (const QModelIndex &parent, int first, int last)Inherited
voidbeginInsertRows (const QModelIndex &parent, int first, int last)Inherited
boolbeginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)Inherited
boolbeginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)Inherited
voidbeginRemoveColumns (const QModelIndex &parent, int first, int last)Inherited
voidbeginRemoveRows (const QModelIndex &parent, int first, int last)Inherited
voidbeginResetModel ()Inherited
voidchangePersistentIndex (const QModelIndex &from, const QModelIndex &to)Inherited
voidchangePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)Inherited
QModelIndexcreateIndex (int row, int column, void *data=0) const Inherited
QModelIndexcreateIndex (int row, int column, int id) const Inherited
QModelIndexcreateIndex (int row, int column, quint32 id) const Inherited
booldecodeData (int row, int column, const QModelIndex &parent, QDataStream &stream)Inherited
virtual booldeleteRowFromTable (int row)Inherited
voidencodeData (const QModelIndexList &indexes, QDataStream &stream) const Inherited
voidendInsertColumns ()Inherited
voidendInsertRows ()Inherited
voidendMoveColumns ()Inherited
voidendMoveRows ()Inherited
voidendRemoveColumns ()Inherited
voidendRemoveRows ()Inherited
voidendResetModel ()Inherited
QModelIndexindexInQuery (const QModelIndex &item) const Inherited
QModelIndexListpersistentIndexList () const Inherited
QAbstractItemModel (QAbstractItemModelPrivate &dd, QObject *parent=0)Inherited
QAbstractTableModel (QAbstractItemModelPrivate &dd, QObject *parent)Inherited
QSqlQueryModel (QSqlQueryModelPrivate &dd, QObject *parent=0)Inherited
QSqlTableModel (QSqlTableModelPrivate &dd, QObject *parent=0, QSqlDatabase db=QSqlDatabase())Inherited
virtual voidqueryChange ()Inherited
voidreset ()Inherited
voidsetLastError (const QSqlError &error)Inherited
voidsetPrimaryKey (const QSqlIndex &key)Inherited
voidsetQuery (const QSqlQuery &query)Inherited
voidsetRoleNames (const QHash< int, QByteArray > &roleNames)Inherited

Public Slots Index

virtual voidrevertRow (int row)
virtual voidrevert ()Inherited
voidrevertAll ()Inherited
virtual boolsubmit ()Inherited
boolsubmitAll ()Inherited

Signals Index

Only has inherited signals

voidbeforeDelete (int row)Inherited
voidbeforeInsert (QSqlRecord &record)Inherited
voidbeforeUpdate (int row, QSqlRecord &record)Inherited
voiddataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)Inherited
voidheaderDataChanged (Qt::Orientation orientation, int first, int last)Inherited
voidlayoutAboutToBeChanged ()Inherited
voidlayoutChanged ()Inherited
voidprimeInsert (int row, QSqlRecord &record)Inherited

Public Types



EditStrategy Inherited


Public Functions

QSqlRelationalTableModel (

virtual~QSqlRelationalTableModel ()


virtual void clear ()

virtualQVariant data (

QSqlRelation relation (
  • intcolumn)

virtualQSqlTableModel * relationModel (
  • intcolumn)

virtual bool removeColumns (

virtual bool select ()

virtual bool setData (

void setJoinMode (
  • QSqlRelationalTableModel::JoinModejoinMode)

virtual void setRelation (

virtual void setTable (

virtualQModelIndex buddy (Inherited

virtual bool canFetchMore (Inherited

virtual int columnCount (Inherited

QSqlDatabase database ()Inherited

virtual bool dropMimeData (Inherited

EditStrategy editStrategy ()Inherited

virtual void fetchMore (Inherited

int fieldIndex (Inherited

QString filter ()Inherited

virtual Qt::ItemFlags flags (Inherited

bool hasIndex (Inherited

virtualQVariant headerData (
  • intsection,
  • Qt::Orientationorientation,
  • introle )

virtualQModelIndex index (Inherited

bool insertColumn (Inherited

virtual bool insertColumns (Inherited

bool insertRecord (Inherited

bool insertRow (Inherited

virtual bool insertRows (Inherited

bool isDirty (Inherited

virtualQMap< int, QVariant > itemData (Inherited

QSqlError lastError ()Inherited

virtualQModelIndexList match (Inherited

virtualQMimeData * mimeData (Inherited

virtualQStringList mimeTypes ()Inherited

QSqlIndex primaryKey ()Inherited

QAbstractItemModel (Inherited

QAbstractTableModel (Inherited

QSqlQueryModel (Inherited

QSqlTableModel (Inherited

QSqlQuery query ()Inherited

QSqlRecord record (
  • introw)

QSqlRecord record ()Inherited

bool removeColumn (Inherited

bool removeRow (Inherited

virtual bool removeRows (Inherited

const QHash< int, QByteArray > & roleNames ()Inherited

virtual int rowCount (Inherited

virtual void setEditStrategy (
  • EditStrategystrategy)

virtual void setFilter (Inherited

virtual bool setHeaderData (
  • intsection,
  • Qt::Orientationorientation,
  • const QVariant &value,
  • introle )

virtual bool setItemData (Inherited

void setQuery (Inherited

bool setRecord (Inherited

virtual void setSort (
  • intcolumn,
  • Qt::SortOrderorder )

void setSupportedDragActions (
  • Qt::DropActions)

QModelIndex sibling (Inherited

virtual void sort (
  • intcolumn,
  • Qt::SortOrderorder )

virtualQSize span (Inherited

Qt::DropActions supportedDragActions ()Inherited

virtual Qt::DropActions supportedDropActions ()Inherited

QString tableName ()Inherited

Protected Functions

virtual bool insertRowIntoTable (

virtualQString orderByClause ()

virtualQString selectStatement ()

virtual bool updateRowInTable (

void beginInsertColumns (Inherited

void beginInsertRows (Inherited

bool beginMoveColumns (
  • const QModelIndex &sourceParent,
  • intsourceFirst,
  • intsourceLast,
  • const QModelIndex &destinationParent,
  • intdestinationColumn )

bool beginMoveRows (
  • const QModelIndex &sourceParent,
  • intsourceFirst,
  • intsourceLast,
  • const QModelIndex &destinationParent,
  • intdestinationRow )

void beginRemoveColumns (Inherited

void beginRemoveRows (Inherited

void beginResetModel ()Inherited

void changePersistentIndex (Inherited

void changePersistentIndexList (Inherited

QModelIndex createIndex (
  • introw,
  • intcolumn,
  • void *data )

QModelIndex createIndex (
  • introw,
  • intcolumn,
  • intid )

QModelIndex createIndex (
  • introw,
  • intcolumn,
  • quint32id )

bool decodeData (Inherited

virtual bool deleteRowFromTable (
  • introw)

void encodeData (Inherited

void endInsertColumns ()Inherited

void endInsertRows ()Inherited

void endMoveColumns ()Inherited

void endMoveRows ()Inherited

void endRemoveColumns ()Inherited

void endRemoveRows ()Inherited

void endResetModel ()Inherited

QModelIndex indexInQuery (Inherited

QModelIndexList persistentIndexList ()Inherited

QAbstractItemModel (
  • QAbstractItemModelPrivate &dd,
  • QObject *parent )

QAbstractTableModel (
  • QAbstractItemModelPrivate &dd,
  • QObject *parent )

QSqlQueryModel (
  • QSqlQueryModelPrivate &dd,
  • QObject *parent )

QSqlTableModel (Inherited

virtual void queryChange ()Inherited

void reset ()Inherited

void setLastError (Inherited

void setPrimaryKey (Inherited

void setQuery (Inherited

void setRoleNames (Inherited

Public Slots

virtual void revertRow (
  • introw)

virtual void revert ()Inherited

void revertAll ()Inherited

virtual bool submit ()Inherited

bool submitAll ()Inherited


(Only has inherited signals)

void beforeDelete (
  • introw)

void beforeInsert (Inherited

void beforeUpdate (Inherited

void dataChanged (Inherited

void headerDataChanged (
  • Qt::Orientationorientation,
  • intfirst,
  • intlast )

void layoutAboutToBeChanged ()Inherited

void layoutChanged ()Inherited

void primeInsert (Inherited

Last modified: 2015-07-24

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus