Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSqlTableModelPrivate Class Reference

#include <qsqltablemodel_p.h>

+ Inheritance diagram for QSqlTableModelPrivate:
+ Collaboration diagram for QSqlTableModelPrivate:

Classes

class  ModifiedRow
 

Public Types

enum  Op { None , Insert , Update , Delete }
 
typedef QMap< int, ModifiedRowCacheMap
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QSqlTableModelPrivate ()
 
 ~QSqlTableModelPrivate ()
 
void clear ()
 
virtual void clearCache ()
 
QSqlRecord record (const QList< QVariant > &values) const
 
bool exec (const QString &stmt, bool prepStatement, const QSqlRecord &rec, const QSqlRecord &whereValues)
 
virtual void revertCachedRow (int row)
 
virtual int nameToIndex (const QString &name) const
 
QString strippedFieldName (const QString &name) const
 
int insertCount (int maxRow=-1) const
 
void initRecordAndPrimaryIndex ()
 
- Public Member Functions inherited from QSqlQueryModelPrivate
 QSqlQueryModelPrivate ()
 
 ~QSqlQueryModelPrivate ()
 
void prefetch (int)
 
void initColOffsets (int size)
 
int columnInQuery (int modelColumn) const
 
- Public Member Functions inherited from QAbstractItemModelPrivate
 QAbstractItemModelPrivate ()
 
 ~QAbstractItemModelPrivate ()
 
void removePersistentIndexData (QPersistentModelIndexData *data)
 
void movePersistentIndexes (const QList< QPersistentModelIndexData * > &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
 
void rowsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void rowsRemoved (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void columnsInserted (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void columnsRemoved (const QModelIndex &parent, int first, int last)
 
void itemsAboutToBeMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation)
 
void itemsMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
 
bool allowMove (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
 Returns whether a move operation is valid.
 
virtual void executePendingOperations () const
 
QModelIndex createIndex (int row, int column, void *data=nullptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
bool indexValid (const QModelIndex &index) const
 
void invalidatePersistentIndexes ()
 
void invalidatePersistentIndex (const QModelIndex &index)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Public Attributes

QSqlDatabase db
 
int sortColumn
 
Qt::SortOrder sortOrder
 
QSqlTableModel::EditStrategy strategy
 
bool busyInsertingRows
 
QSqlQuery editQuery = { QSqlQuery(nullptr) }
 
QSqlIndex primaryIndex
 
QString tableName
 
QString filter
 
QString autoColumn
 
CacheMap cache
 
- Public Attributes inherited from QSqlQueryModelPrivate
QSqlQuery query = { QSqlQuery(nullptr) }
 
QSqlError error
 
QModelIndex bottom
 
QSqlRecord rec
 
uint atEnd: 1
 
QList< QHash< int, QVariant > > headers
 
QVarLengthArray< int, 56 > colOffsets
 
int nestedResetLevel
 
- Public Attributes inherited from QAbstractItemModelPrivate
QStack< Changechanges
 
struct QAbstractItemModelPrivate::Persistent persistent
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Static Public Member Functions inherited from QAbstractItemModelPrivate
static QAbstractItemModelstaticEmptyModel ()
 
static bool variantLessThan (const QVariant &v1, const QVariant &v2)
 
static const QHash< int, QByteArray > & defaultRoleNames ()
 
static bool isVariantLessThan (const QVariant &left, const QVariant &right, Qt::CaseSensitivity cs=Qt::CaseSensitive, bool isLocaleAware=false)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Detailed Description

Definition at line 27 of file qsqltablemodel_p.h.

Member Typedef Documentation

◆ CacheMap

Definition at line 153 of file qsqltablemodel_p.h.

Member Enumeration Documentation

◆ Op

Enumerator
None 
Insert 
Update 
Delete 

Definition at line 66 of file qsqltablemodel_p.h.

Constructor & Destructor Documentation

◆ QSqlTableModelPrivate()

QSqlTableModelPrivate::QSqlTableModelPrivate ( )
inline

Definition at line 32 of file qsqltablemodel_p.h.

◆ ~QSqlTableModelPrivate()

QSqlTableModelPrivate::~QSqlTableModelPrivate ( )

Definition at line 24 of file qsqltablemodel.cpp.

Member Function Documentation

◆ clear()

void QSqlTableModelPrivate::clear ( )

Definition at line 72 of file qsqltablemodel.cpp.

References Qt::AscendingOrder, cache, QString::clear(), QMap< Key, T >::clear(), QSqlQuery::clear(), QSqlRecord::clear(), editQuery, primaryIndex, QSqlQueryModelPrivate::rec, sortColumn, sortOrder, and tableName.

+ Here is the call graph for this function:

◆ clearCache()

void QSqlTableModelPrivate::clearCache ( )
virtual

Reimplemented in QSqlRelationalTableModelPrivate.

Definition at line 84 of file qsqltablemodel.cpp.

References cache, and QMap< Key, T >::clear().

Referenced by QSqlRelationalTableModelPrivate::clearCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exec()

bool QSqlTableModelPrivate::exec ( const QString & stmt,
bool prepStatement,
const QSqlRecord & rec,
const QSqlRecord & whereValues )

◆ initRecordAndPrimaryIndex()

void QSqlTableModelPrivate::initRecordAndPrimaryIndex ( )

Definition at line 65 of file qsqltablemodel.cpp.

References QSqlRecord::count(), db, QSqlQueryModelPrivate::initColOffsets(), QSqlDatabase::primaryIndex(), primaryIndex, QSqlQueryModelPrivate::rec, QSqlDatabase::record(), and tableName.

+ Here is the call graph for this function:

◆ insertCount()

int QSqlTableModelPrivate::insertCount ( int maxRow = -1) const

Definition at line 53 of file qsqltablemodel.cpp.

References cache, QMap< Key, T >::constBegin(), QMap< Key, T >::constEnd(), and i.

+ Here is the call graph for this function:

◆ nameToIndex()

int QSqlTableModelPrivate::nameToIndex ( const QString & name) const
virtual

Reimplemented in QSqlRelationalTableModelPrivate.

Definition at line 40 of file qsqltablemodel.cpp.

References QSqlRecord::indexOf(), QSqlQueryModelPrivate::rec, and strippedFieldName().

Referenced by QSqlRelationalTableModelPrivate::nameToIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ record()

QSqlRecord QSqlTableModelPrivate::record ( const QList< QVariant > & values) const

Populates our record with values.

Definition at line 32 of file qsqltablemodel.cpp.

References i, QSqlQueryModelPrivate::rec, and QSqlRecord::setValue().

+ Here is the call graph for this function:

◆ revertCachedRow()

void QSqlTableModelPrivate::revertCachedRow ( int row)
virtual

Reimplemented in QSqlRelationalTableModelPrivate.

Definition at line 89 of file qsqltablemodel.cpp.

References cache, Delete, emit, QMap< Key, T >::end(), QMap< Key, T >::erase(), QMap< Key, T >::find(), QMap< Key, T >::insert(), Insert, it, None, Q_ASSERT_X, Update, and QMap< Key, T >::value().

Referenced by QSqlRelationalTableModelPrivate::revertCachedRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strippedFieldName()

QString QSqlTableModelPrivate::strippedFieldName ( const QString & name) const

Definition at line 45 of file qsqltablemodel.cpp.

References db, QSqlDatabase::driver(), QSqlDriver::FieldName, QSqlDriver::isIdentifierEscaped(), and QSqlDriver::stripDelimiters().

Referenced by nameToIndex(), and QSqlRelationalTableModelPrivate::nameToIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ autoColumn

QString QSqlTableModelPrivate::autoColumn

Definition at line 64 of file qsqltablemodel_p.h.

◆ busyInsertingRows

bool QSqlTableModelPrivate::busyInsertingRows

Definition at line 58 of file qsqltablemodel_p.h.

◆ cache

CacheMap QSqlTableModelPrivate::cache

Definition at line 154 of file qsqltablemodel_p.h.

Referenced by clear(), clearCache(), insertCount(), and revertCachedRow().

◆ db

QSqlDatabase QSqlTableModelPrivate::db

Definition at line 52 of file qsqltablemodel_p.h.

Referenced by exec(), initRecordAndPrimaryIndex(), and strippedFieldName().

◆ editQuery

QSqlQuery QSqlTableModelPrivate::editQuery = { QSqlQuery(nullptr) }

Definition at line 60 of file qsqltablemodel_p.h.

Referenced by clear(), and exec().

◆ filter

QString QSqlTableModelPrivate::filter

Definition at line 63 of file qsqltablemodel_p.h.

◆ primaryIndex

QSqlIndex QSqlTableModelPrivate::primaryIndex

Definition at line 61 of file qsqltablemodel_p.h.

Referenced by clear(), and initRecordAndPrimaryIndex().

◆ sortColumn

int QSqlTableModelPrivate::sortColumn

Definition at line 54 of file qsqltablemodel_p.h.

Referenced by clear().

◆ sortOrder

Qt::SortOrder QSqlTableModelPrivate::sortOrder

Definition at line 55 of file qsqltablemodel_p.h.

Referenced by clear().

◆ strategy

QSqlTableModel::EditStrategy QSqlTableModelPrivate::strategy

Definition at line 57 of file qsqltablemodel_p.h.

◆ tableName

QString QSqlTableModelPrivate::tableName

The documentation for this class was generated from the following files: