Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
QtSql.QSqlRelationalTableModel Class Reference

The QSqlRelationalTableModel class provides an editable data model for a single database table, with foreign key support. More...

Inheritance diagram for QtSql.QSqlRelationalTableModel:
Collaboration diagram for QtSql.QSqlRelationalTableModel:

Public Types

enum  JoinMode { InnerJoin = 0, LeftJoin = 1 }
  More...
 
- Public Types inherited from QtSql.QSqlTableModel
enum  EditStrategy { OnFieldChange = 0, OnManualSubmit = 2, OnRowChange = 1 }
  More...
 

Public Member Functions

 QSqlRelationalTableModel (QObject parent=null)
  More...
 
 QSqlRelationalTableModel (QObject parent, QSqlDatabase db)
  More...
 
override void CreateProxy ()
 
override void Clear ()
  More...
 
override object Data (QModelIndex item, int role=(int) Qt.ItemDataRole.DisplayRole)
  More...
 
new QSqlRelation Relation (int column)
  More...
 
virtual QSqlTableModel RelationModel (int column)
  More...
 
new bool RemoveColumns (int column, int count)
  More...
 
override bool RemoveColumns (int column, int count, QModelIndex parent)
  More...
 
override void RevertRow (int row)
  More...
 
override bool Select ()
  More...
 
override bool SetData (QModelIndex item, object value, int role=(int) Qt.ItemDataRole.EditRole)
  More...
 
new void SetJoinMode (QSqlRelationalTableModel.JoinMode joinMode)
  More...
 
virtual void SetRelation (int column, QSqlRelation relation)
  More...
 
override void SetTable (string tableName)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtSql.QSqlTableModel
 QSqlTableModel (QObject parent=null)
  More...
 
 QSqlTableModel (QObject parent, QSqlDatabase db)
  More...
 
override void CreateProxy ()
 
override void Clear ()
  More...
 
override object Data (QModelIndex idx, int role=(int) Qt.ItemDataRole.DisplayRole)
  More...
 
new int FieldIndex (string fieldName)
  More...
 
override Qt.ItemFlag Flags (QModelIndex index)
  More...
 
override object HeaderData (int section, Qt.Orientation orientation, int role=(int) Qt.ItemDataRole.DisplayRole)
  More...
 
new bool InsertRecord (int row, QSqlRecord record)
  More...
 
new bool InsertRows (int row, int count)
  More...
 
override bool InsertRows (int row, int count, QModelIndex parent)
  More...
 
new bool IsDirty (QModelIndex index)
  More...
 
new bool RemoveColumns (int column, int count)
  More...
 
override bool RemoveColumns (int column, int count, QModelIndex parent)
  More...
 
new bool RemoveRows (int row, int count)
  More...
 
override bool RemoveRows (int row, int count, QModelIndex parent)
  More...
 
override void Revert ()
  More...
 
new void RevertAll ()
  More...
 
new int RowCount ()
  More...
 
override int RowCount (QModelIndex parent)
  More...
 
override bool SetData (QModelIndex index, object value, int role=(int) Qt.ItemDataRole.EditRole)
  More...
 
new bool SetRecord (int row, QSqlRecord record)
  More...
 
virtual void SetSort (int column, Qt.SortOrder order)
  More...
 
override void Sort (int column, Qt.SortOrder order)
  More...
 
override bool Submit ()
  More...
 
new bool SubmitAll ()
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtSql.QSqlQueryModel
 QSqlQueryModel (QObject parent=null)
  More...
 
new bool CanFetchMore ()
  More...
 
override bool CanFetchMore (QModelIndex parent)
  More...
 
new int ColumnCount ()
  More...
 
override int ColumnCount (QModelIndex parent)
  More...
 
new void FetchMore ()
  More...
 
override void FetchMore (QModelIndex parent)
  More...
 
new bool InsertColumns (int column, int count)
  More...
 
override bool InsertColumns (int column, int count, QModelIndex parent)
  More...
 
new QSqlRecord Record ()
  More...
 
new QSqlRecord Record (int row)
  More...
 
new bool RemoveColumns (int column, int count)
  More...
 
new int RowCount ()
  More...
 
override bool SetHeaderData (int section, Qt.Orientation orientation, object value, int role=(int) Qt.ItemDataRole.EditRole)
  More...
 
new void SetQuery (string query)
  More...
 
new void SetQuery (string query, QSqlDatabase db)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QAbstractTableModel
 QAbstractTableModel (QObject parent=null)
  More...
 
override bool DropMimeData (QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent)
  More...
 
new QModelIndex Index (int row, int column)
  More...
 
override QModelIndex Index (int row, int column, QModelIndex parent)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QAbstractItemModel
 QAbstractItemModel (QObject parent=null)
  More...
 
virtual QModelIndex Buddy (QModelIndex index)
  More...
 
new bool HasChildren ()
  More...
 
virtual bool HasChildren (QModelIndex parent)
  More...
 
new bool HasIndex (int row, int column)
  More...
 
new bool HasIndex (int row, int column, QModelIndex parent)
  More...
 
new QModelIndex Index (int row, int column)
  More...
 
new bool InsertColumn (int column)
  More...
 
new bool InsertColumn (int column, QModelIndex parent)
  More...
 
new bool InsertColumns (int column, int count)
  More...
 
new bool InsertRow (int row)
  More...
 
new bool InsertRow (int row, QModelIndex parent)
  More...
 
new bool InsertRows (int row, int count)
  More...
 
virtual
System.Collections.Generic.Dictionary
< System.Int32, System.Object > 
ItemData (QModelIndex index)
  More...
 
virtual
System.Collections.Generic.List
< QModelIndex
Match (QModelIndex start, int role, object value, int hits=1, Qt.MatchFlag flags=Qt.MatchFlag.MatchStartsWith|Qt.MatchFlag.MatchWrap)
  More...
 
virtual QMimeData MimeData (System.Collections.Generic.List< QModelIndex > indexes)
  More...
 
new QObject Parent ()
 
abstract QModelIndex Parent (QModelIndex child)
  More...
 
new bool RemoveColumn (int column)
  More...
 
new bool RemoveColumn (int column, QModelIndex parent)
  More...
 
new bool RemoveColumns (int column, int count)
  More...
 
new bool RemoveRow (int row)
  More...
 
new bool RemoveRow (int row, QModelIndex parent)
  More...
 
new bool RemoveRows (int row, int count)
  More...
 
new int RowCount ()
  More...
 
virtual bool SetItemData (QModelIndex index, System.Collections.Generic.Dictionary< System.Int32, System.Object > roles)
  More...
 
new QModelIndex Sibling (int row, int column, QModelIndex idx)
  More...
 
virtual QSize Span (QModelIndex index)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
  More...
 
new bool BlockSignals (bool b)
  More...
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
new void DeleteLater ()
  More...
 
new bool Disconnect (QObject receiver, string member=null)
  More...
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
  More...
 
new void DumpObjectInfo ()
  More...
 
new void DumpObjectTree ()
  More...
 
virtual bool OnEvent (QEvent e)
  More...
 
virtual bool EventFilter (QObject watched, QEvent @event)
  More...
 
new bool Inherits (string classname)
  More...
 
new void InstallEventFilter (QObject filterObj)
  More...
 
new void KillTimer (int id)
  More...
 
new object Property (string name)
  More...
 
new void RemoveEventFilter (QObject obj)
  More...
 
new bool SetProperty (string name, object value)
  More...
 
new void SetUserData (uint id, QObjectUserData data)
 
new int StartTimer (int interval)
  More...
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtSql.QSqlTableModel
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtSql.QSqlQueryModel
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QAbstractTableModel
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QAbstractItemModel
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
  More...
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
  More...
 
static string Tr (string s, string c=null)
  More...
 
static string Tr (string s, string c, int n)
  More...
 
static string TrUtf8 (string s, string c=null)
  More...
 
static string TrUtf8 (string s, string c, int n)
  More...
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Write (QDataStream stream, QPoint point)
  More...
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
  More...
 
static QDataStream Write (QDataStream stream, QPointF point)
  More...
 
static QDataStream Write (QDataStream @out, QChar chr)
  More...
 
static QDataStream Write (QDataStream @out, QByteArray ba)
  More...
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
  More...
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
  More...
 
static QDataStream Write (QDataStream @out, QUrl url)
  More...
 
static QDataStream Write (QDataStream @out, QTime time)
  More...
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
  More...
 
static QDataStream Write (QDataStream s, QUuid id)
  More...
 
static QDataStream Write (QDataStream stream, QLine line)
  More...
 
static QDataStream Write (QDataStream @out, QDate date)
  More...
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
  More...
 
static QDataStream Write (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Write (QDataStream stream, QSize size)
  More...
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
  More...
 
static QDataStream Read (QDataStream @in, QChar chr)
  More...
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
  More...
 
static QDataStream Read (QDataStream @in, QUrl url)
  More...
 
static QDataStream Read (QDataStream s, QUuid id)
  More...
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
  More...
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Read (QDataStream stream, QPointF point)
  More...
 
static QDataStream Read (QDataStream stream, QLine line)
  More...
 
static QDataStream Read (QDataStream @in, QBitArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSize size)
  More...
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
  More...
 
static QDataStream Read (QDataStream @in, QTime time)
  More...
 
static QDataStream Read (QDataStream stream, QPoint point)
  More...
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
  More...
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
  More...
 
static double QAcos (double v)
  More...
 
static void QAddPostRoutine (System.Action ptr)
  More...
 
static double QAsin (double v)
  More...
 
static double QAtan (double v)
  More...
 
static double QAtan2 (double x, double y)
  More...
 
static void QBadAlloc ()
 
static int QCeil (double v)
  More...
 
static ushort QChecksum (string s, uint len)
  More...
 
static QByteArray QCompress (QByteArray data, int compressionLevel=-1)
  More...
 
static QByteArray QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
  More...
 
static double QCos (double v)
  More...
 
static double QExp (double v)
  More...
 
static double QFabs (double v)
 
static double QFastCos (double x)
 
static double QFastSin (double x)
 
static string QFlagLocation (string method)
 
static int QFloor (double v)
  More...
 
static bool QFuzzyCompare (double p1, double p2)
  More...
 
static bool QFuzzyCompare (float p1, float p2)
  More...
 
static bool QFuzzyIsNull (double d)
 
static bool QFuzzyIsNull (float f)
 
static uint QHash (QBitArray key)
  More...
 
static uint QHash (QChar key)
  More...
 
static uint QHash (QStringRef key)
 
static uint QHash (QUrl url)
  More...
 
static uint QHash (QPersistentModelIndex index)
 
static uint QHash (QByteArray key)
  More...
 
static uint QHash (QModelIndex index)
 
static uint QHash (uint key)
  More...
 
static uint QHash (char key)
  More...
 
static uint QHash (byte key)
  More...
 
static uint QHash (short key)
  More...
 
static uint QHash (NativeLong key)
  More...
 
static uint QHash (ushort key)
  More...
 
static uint QHash (long key)
  More...
 
static uint QHash (ulong key)
  More...
 
static uint QHash (int key)
  More...
 
static uint QHash (string key)
  More...
 
static uint QHash (NativeULong key)
  More...
 
static Qt.ActionQtMsgTypeString QInstallMsgHandler (Qt.ActionQtMsgTypeString handler)
  More...
 
static int QIntCast (float f)
 
static int QIntCast (double f)
 
static bool QIsFinite (double d)
 
static bool QIsFinite (float f)
 
static bool QIsInf (float f)
 
static bool QIsInf (double d)
 
static bool QIsNaN (float f)
 
static bool QIsNaN (double d)
 
static bool QIsNull (float f)
 
static bool QIsNull (double d)
 
static double QLn (double v)
  More...
 
static double QPow (double x, double y)
  More...
 
static void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
  More...
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
  More...
 
static long QRound64 (double d)
  More...
 
static double QSin (double v)
  More...
 
static double QSqrt (double v)
  More...
 
static bool QStringComparisonHelper (QStringRef s1, string s2)
 
static double QTan (double v)
  More...
 
static QByteArray QUncompress (QByteArray data)
  More...
 
static QByteArray QUncompress (Pointer< byte > data, int nbytes)
  More...
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
  More...
 
static bool Qputenv (string varName, QByteArray value)
  More...
 
static void Qsrand (uint seed)
  More...
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
  More...
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
  More...
 
static Pointer< sbyte > Qstrdup (string src)
  More...
 
static int Qstricmp (string str1, string str2)
  More...
 
static uint Qstrlen (string str)
  More...
 
static int Qstrncmp (string str1, string str2, uint len)
  More...
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
  More...
 
static int Qstrnicmp (string str1, string str2, uint len)
  More...
 
static uint Qstrnlen (string str, uint maxlen)
  More...
 

Protected Member Functions

 QSqlRelationalTableModel (System.Type dummy)
 
override bool InsertRowIntoTable (QSqlRecord values)
  More...
 
override string OrderByClause ()
  More...
 
override string SelectStatement ()
  More...
 
override bool UpdateRowInTable (int row, QSqlRecord values)
  More...
 
- Protected Member Functions inherited from QtSql.QSqlTableModel
 QSqlTableModel (System.Type dummy)
 
new void OnBeforeDelete (int row)
  More...
 
new void OnBeforeInsert (QSqlRecord record)
  More...
 
new void OnBeforeUpdate (int row, QSqlRecord record)
  More...
 
virtual bool DeleteRowFromTable (int row)
  More...
 
new QModelIndex IndexInQuery (QModelIndex item)
  More...
 
new void OnPrimeInsert (int row, QSqlRecord record)
  More...
 
new void SetQuery (QSqlQuery query)
  More...
 
- Protected Member Functions inherited from QtSql.QSqlQueryModel
 QSqlQueryModel (System.Type dummy)
 
new QModelIndex IndexInQuery (QModelIndex item)
  More...
 
virtual void QueryChange ()
  More...
 
- Protected Member Functions inherited from QtCore.QAbstractTableModel
 QAbstractTableModel (System.Type dummy)
 
- Protected Member Functions inherited from QtCore.QAbstractItemModel
 QAbstractItemModel (System.Type dummy)
 
new void BeginInsertColumns (QModelIndex parent, int first, int last)
  More...
 
new void BeginInsertRows (QModelIndex parent, int first, int last)
  More...
 
new bool BeginMoveColumns (QModelIndex sourceParent, int sourceFirst, int sourceLast, QModelIndex destinationParent, int destinationColumn)
  More...
 
new bool BeginMoveRows (QModelIndex sourceParent, int sourceFirst, int sourceLast, QModelIndex destinationParent, int destinationRow)
  More...
 
new void BeginRemoveColumns (QModelIndex parent, int first, int last)
  More...
 
new void BeginRemoveRows (QModelIndex parent, int first, int last)
  More...
 
new void BeginResetModel ()
  More...
 
new void ChangePersistentIndex (QModelIndex from, QModelIndex to)
  More...
 
new void ChangePersistentIndexList (System.Collections.Generic.List< QModelIndex > from, System.Collections.Generic.List< QModelIndex > to)
  More...
 
new QModelIndex CreateIndex (int row, int column)
  More...
 
new QModelIndex CreateIndex (int row, int column, int id)
  More...
 
new QModelIndex CreateIndex (int row, int column, uint id)
  More...
 
new void OnDataChanged (QModelIndex topLeft, QModelIndex bottomRight)
  More...
 
new bool DecodeData (int row, int column, QModelIndex parent, QDataStream stream)
 
new void EncodeData (System.Collections.Generic.List< QModelIndex > indexes, QDataStream stream)
 
new void EndInsertColumns ()
  More...
 
new void EndInsertRows ()
  More...
 
new void EndMoveColumns ()
  More...
 
new void EndMoveRows ()
  More...
 
new void EndRemoveColumns ()
  More...
 
new void EndRemoveRows ()
  More...
 
new void EndResetModel ()
  More...
 
new void OnHeaderDataChanged (Qt.Orientation orientation, int first, int last)
  More...
 
new void OnLayoutAboutToBeChanged ()
  More...
 
new void OnLayoutChanged ()
  More...
 
new void Reset ()
  More...
 
new void ResetInternalData ()
  More...
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent @event)
  More...
 
virtual void ConnectNotify (string signal)
  More...
 
virtual void OnCustomEvent (QEvent @event)
  More...
 
new void OnDestroyed (QObject obj=null)
  More...
 
virtual void DisconnectNotify (string signal)
  More...
 
new int Receivers (string signal)
  More...
 
virtual void OnTimerEvent (QTimerEvent @event)
  More...
 

Properties

static new QMetaObject StaticMetaObject [get]
 
new
IQSqlRelationalTableModelSignals 
Emit [get]
 
- Properties inherited from QtSql.QSqlTableModel
Slot< System.Int32, QSqlRecordPrimeInsert
  More...
 
Slot< QSqlRecordBeforeInsert
  More...
 
Slot< System.Int32, QSqlRecordBeforeUpdate
  More...
 
Slot< System.Int32 > BeforeDelete
  More...
 
virtual QSqlTableModel.EditStrategy editStrategy [get, set]
  More...
 
virtual string Filter [get, set]
  More...
 
QSqlIndex PrimaryKey [get, set]
  More...
 
QSqlDatabase Database [get]
  More...
 
string TableName [get]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQSqlTableModelSignals Emit [get]
 
- Properties inherited from QtSql.QSqlQueryModel
QSqlError LastError [get, set]
  More...
 
QSqlQuery Query [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQSqlQueryModelSignals Emit [get]
 
- Properties inherited from QtCore.QAbstractTableModel
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractTableModelSignals Emit [get]
 
- Properties inherited from QtCore.QAbstractItemModel
Slot< QModelIndex, QModelIndexDataChanged
  More...
 
Slot< Qt.Orientation,
System.Int32, System.Int32 > 
HeaderDataChanged
  More...
 
Slot LayoutChanged
  More...
 
Slot LayoutAboutToBeChanged
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
RowsAboutToBeInserted
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
RowsInserted
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
RowsAboutToBeRemoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
RowsRemoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
ColumnsAboutToBeInserted
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
ColumnsInserted
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
ColumnsAboutToBeRemoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32 > 
ColumnsRemoved
  More...
 
Slot ModelAboutToBeReset
  More...
 
Slot ModelReset
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32,
QModelIndex, System.Int32 > 
RowsAboutToBeMoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32,
QModelIndex, System.Int32 > 
RowsMoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32,
QModelIndex, System.Int32 > 
ColumnsAboutToBeMoved
  More...
 
Slot< QModelIndex,
System.Int32, System.Int32,
QModelIndex, System.Int32 > 
ColumnsMoved
  More...
 
System.Collections.Generic.Dictionary
< System.Int32, QByteArray
RoleNames [get, set]
  More...
 
Qt.DropAction SupportedDragActions [get, set]
  More...
 
virtual
System.Collections.Generic.List
< string > 
MimeTypes [get]
  More...
 
System.Collections.Generic.List
< QModelIndex
PersistentIndexList [get]
  More...
 
virtual Qt.DropAction SupportedDropActions [get]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractItemModelSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
  More...
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
  More...
 
Slot< QObjectDestroyedObj
  More...
 
Slot Destroyed
  More...
 
QObject Parent [get, set]
  More...
 
System.Collections.Generic.List
< QObject
Children [get]
  More...
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
  More...
 
bool IsWidgetType [get]
  More...
 
static uint RegisterUserData [get]
 
QObject Sender [get]
  More...
 
int SenderSignalIndex [get]
  More...
 
bool SignalsBlocked [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
  More...
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- Properties inherited from QtCore.Qt
static string QAppName [get]
 
static double QInf [get]
 
static double QQNaN [get]
 
static double QSNaN [get]
 
static bool QSharedBuild [get]
 
static string QVersion [get]
  More...
 
static int Qrand [get]
  More...
 

Additional Inherited Members

- Static Public Attributes inherited from QtCore.Qt
</para > *< para > Creating QM
files suitable for use with
this[SmokeMethod("qtTrId(const
char*, int)")] static strin 
QtTrId )(string id, int n=-1)
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QSqlRelationalTableModel class provides an editable data model for a single database table, with foreign key support.

QSqlRelationalTableModel acts like QSqlTableModel, but allows columns to be set as foreign keys into other database tables.

The screenshot on the left shows a plain QSqlTableModel in a QTableView. Foreign keys (city and country) aren't resolved to human-readable values. The screenshot on the right shows a QSqlRelationalTableModel, with foreign keys resolved into human-readable text strings.

The following code snippet shows how the QSqlRelationalTableModel was set up:

model->setTable("employee");

model->setRelation(2, QSqlRelation("city", "id", "name"));

model->setRelation(3, QSqlRelation("country", "id", "name"));

The setRelation() function calls establish a relationship between two tables. The first call specifies that column 2 in table employee is a foreign key that maps with field id of table city, and that the view should present the city's name field to the user. The second call does something similar with column 3.

If you use a read-write QSqlRelationalTableModel, you probably want to use QSqlRelationalDelegate on the view. Unlike the default delegate, QSqlRelationalDelegate provides a combobox for fields that are foreign keys into other tables. To use the class, simply call QAbstractItemView::setItemDelegate() on the view with an instance of QSqlRelationalDelegate:

QTableView *view = new QTableView;

view->setModel(model);

view->setItemDelegate(new QSqlRelationalDelegate(view));

The sql/relationaltablemodel example illustrates how to use QSqlRelationalTableModel in conjunction with QSqlRelationalDelegate to provide tables with foreign key support.

Notes:

The table must have a primary key declared.

The table's primary key may not contain a relation to another table.

If a relational table contains keys that refer to non-existent rows in the referenced table, the rows containing the invalid keys will not be exposed through the model. The user or the database is responsible for keeping referential integrity.

If a relation's display column name is also used as a column name in the main table, or if it is used as display column name in more than one relation it will be aliased. The alias is is the relation's table name and display column name joined by an underscore (e.g. tablename_columnname). All occurrences of the duplicate display column name are aliased when duplication is detected, but no aliasing is done to the column names in the main table. The aliasing doesn't affect QSqlRelation, so QSqlRelation::displayColumn() will return the original display column name, but QSqlRecord::fieldName() will return aliases.

When using setData() the role should always be Qt::EditRole, and when using data() the role should always be Qt::DisplayRole.

See also QSqlRelation, QSqlRelationalDelegate, and Relational Table Model Example.

Member Enumeration Documentation

This enum specifies the type of mode to use when joining two tables.

This enum was introduced or modified in Qt 4.8.

See also QSqlRelationalTableModel::setJoinMode().

Enumerator
InnerJoin 

Inner join mode, return rows when there is at least one match in both tables.

LeftJoin 

Left join mode, returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2).

Constructor & Destructor Documentation

QtSql.QSqlRelationalTableModel.QSqlRelationalTableModel ( System.Type  dummy)
protected
QtSql.QSqlRelationalTableModel.QSqlRelationalTableModel ( QObject  parent = null)

Creates an empty QSqlRelationalTableModel and sets the parent to parent and the database connection to db. If db is not valid, the default database connection will be used.

Here is the call graph for this function:

QtSql.QSqlRelationalTableModel.QSqlRelationalTableModel ( QObject  parent,
QSqlDatabase  db 
)

Creates an empty QSqlRelationalTableModel and sets the parent to parent and the database connection to db. If db is not valid, the default database connection will be used.

Here is the call graph for this function:

Member Function Documentation

override void QtSql.QSqlRelationalTableModel.Clear ( )
virtual

Reimplemented from QSqlQueryModel::clear().

Reimplemented from QtSql.QSqlQueryModel.

override void QtSql.QSqlRelationalTableModel.CreateProxy ( )
virtual

Reimplemented from QtSql.QSqlQueryModel.

Here is the caller graph for this function:

override object QtSql.QSqlRelationalTableModel.Data ( QModelIndex  item,
int  role = (int) Qt.ItemDataRole.DisplayRole 
)
virtual

Reimplemented from QAbstractItemModel::data().

See also setData().

Reimplemented from QtSql.QSqlQueryModel.

new void QtSql.QSqlRelationalTableModel.Dispose ( )
override bool QtSql.QSqlRelationalTableModel.InsertRowIntoTable ( QSqlRecord  values)
protectedvirtual

Reimplemented from QSqlTableModel::insertRowIntoTable().

Reimplemented from QtSql.QSqlTableModel.

override string QtSql.QSqlRelationalTableModel.OrderByClause ( )
protectedvirtual

Reimplemented from QSqlTableModel::orderByClause().

Reimplemented from QtSql.QSqlTableModel.

new QSqlRelation QtSql.QSqlRelationalTableModel.Relation ( int  column)

Returns the relation for the column column, or an invalid relation if no relation is set.

See also setRelation() and QSqlRelation::isValid().

virtual QSqlTableModel QtSql.QSqlRelationalTableModel.RelationModel ( int  column)
virtual

Returns a QSqlTableModel object for accessing the table for which column is a foreign key, or 0 if there is no relation for the given column.

The returned object is owned by the QSqlRelationalTableModel.

See also setRelation() and relation().

new bool QtSql.QSqlRelationalTableModel.RemoveColumns ( int  column,
int  count 
)

Reimplemented from QAbstractItemModel::removeColumns().

override bool QtSql.QSqlRelationalTableModel.RemoveColumns ( int  column,
int  count,
QModelIndex  parent 
)
virtual

Reimplemented from QAbstractItemModel::removeColumns().

Reimplemented from QtSql.QSqlQueryModel.

override void QtSql.QSqlRelationalTableModel.RevertRow ( int  row)
virtual

Reimplemented from QSqlTableModel::revertRow().

Reimplemented from QtSql.QSqlTableModel.

override bool QtSql.QSqlRelationalTableModel.Select ( )
virtual

Reimplemented from QSqlTableModel::select().

Reimplemented from QtSql.QSqlTableModel.

override string QtSql.QSqlRelationalTableModel.SelectStatement ( )
protectedvirtual

Reimplemented from QSqlTableModel::selectStatement().

Reimplemented from QtSql.QSqlTableModel.

override bool QtSql.QSqlRelationalTableModel.SetData ( QModelIndex  item,
object  value,
int  role = (int) Qt.ItemDataRole.EditRole 
)
virtual

Reimplemented from QAbstractItemModel::setData().

Sets the data for the role in the item with the specified index to the value given. Depending on the edit strategy, the value might be applied to the database at once, or it may be cached in the model.

Returns true if the value could be set, or false on error (for example, if index is out of bounds).

For relational columns, value must be the index, not the display value. The index must also exist in the referenced table, otherwise the function returns false.

See also editStrategy(), data(), submit(), and revertRow().

Reimplemented from QtCore.QAbstractItemModel.

new void QtSql.QSqlRelationalTableModel.SetJoinMode ( QSqlRelationalTableModel.JoinMode  joinMode)

Sets the SQL join mode to the value given by joinMode to show or hide rows with NULL foreign keys.

In InnerJoin mode (the default) these rows will not be shown; use the LeftJoin mode if you want to show them.

This function was introduced in Qt 4.8.

See also QSqlRelationalTableModel::JoinMode.

virtual void QtSql.QSqlRelationalTableModel.SetRelation ( int  column,
QSqlRelation  relation 
)
virtual

Lets the specified column be a foreign index specified by relation.

Example:

model->setTable("employee");

model->setRelation(2, QSqlRelation("city", "id", "name"));

The setRelation() call specifies that column 2 in table employee is a foreign key that maps with field id of table city, and that the view should present the city's name field to the user.

Note: The table's primary key may not contain a relation to another table.

See also relation().

override void QtSql.QSqlRelationalTableModel.SetTable ( string  tableName)
virtual

Reimplemented from QSqlTableModel::setTable().

Reimplemented from QtSql.QSqlTableModel.

static string QtSql.QSqlRelationalTableModel.Tr ( string  s,
string  c = null 
)
static
static string QtSql.QSqlRelationalTableModel.Tr ( string  s,
string  c,
int  n 
)
static
static string QtSql.QSqlRelationalTableModel.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtSql.QSqlRelationalTableModel.TrUtf8 ( string  s,
string  c,
int  n 
)
static
override bool QtSql.QSqlRelationalTableModel.UpdateRowInTable ( int  row,
QSqlRecord  values 
)
protectedvirtual

Reimplemented from QSqlTableModel::updateRowInTable().

Reimplemented from QtSql.QSqlTableModel.

Property Documentation

new IQSqlRelationalTableModelSignals QtSql.QSqlRelationalTableModel.Emit
getprotected
new QMetaObject QtSql.QSqlRelationalTableModel.StaticMetaObject
staticget