List of all members | Public Types | Properties | Public Member Functions | Static Public Member Functions | Protected Member Functions
XSqlTableModel Class Reference

#include <xsqltablemodel.h>

Inheritance diagram for XSqlTableModel:
QSqlRelationalTableModel QSqlTableModel QSqlQueryModel QAbstractTableModel QAbstractItemModel QObject

Public Types

enum  FormatFlags {
  Money, Qty, Curr, Percent,
  Cost, QtyPer, SalesPrice, PurchPrice,
  UOMRatio, ExtPrice, Weight
}
 
enum  itemDataRole { FormatRole, EditorRole, MenuRole }
 

Properties

 objectName
 

Public Member Functions

 XSqlTableModel (QObject *parent=0)
 
 ~XSqlTableModel ()
 
void appendChild (XSqlTableNode *child)
 
XSqlTableNodeappendChild (const QString &tableName, ParameterList &relations)
 
void applyColumnRole (int column, int role, QVariant value)
 
void applyColumnRoles ()
 
void applyColumnRoles (int row)
 
void beforeDelete (int row)
 
void beforeInsert (QSqlRecord &record)
 
void beforeUpdate (int row, QSqlRecord &record)
 
bool blockSignals (bool block)
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
static::QString buildFilter (ParameterList &params)
 
static::ParameterList buildParams (XSqlTableModel *parent, int row, ParameterList relations)
 
virtual bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
XSqlTableNodechild (int index)
 
XSqlTableNodechild (const QString &tableName)
 
const QObjectList & children () const
 
QList< XSqlTableNode * > children ()
 
void clear ()
 
void clearChildren ()
 
virtual int columnCount (const QModelIndex &index) const
 
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void columnsInserted (const QModelIndex &parent, int first, int last)
 
void columnsMoved (const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column)
 
void columnsRemoved (const QModelIndex &parent, int first, int last)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
QSqlDatabase database () const
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
EditStrategy editStrategy () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual void fetchMore (const QModelIndex &parent)
 
int fieldIndex (const QString &fieldName) const
 
QString filter () const
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant formatValue (const QVariant &dataValue, const QVariant &formatValue) const
 
virtual bool hasChildren (const QModelIndex &parent) const
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const
 
bool inherits (const char *className) const
 
bool insertColumn (int column, const QModelIndex &parent)
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent)
 
bool insertRecord (int row, const QSqlRecord &record)
 
bool insertRow (int row, const QModelIndex &parent)
 
virtual bool insertRows (int row, int count, const QModelIndex &parent)
 
void installEventFilter (QObject *filterObj)
 
bool isDirty () const
 
bool isDirty (const QModelIndex &index) const
 
bool isWidgetType () const
 
bool isWindowType () const
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 
void killTimer (int id)
 
QSqlError lastError () const
 
void layoutAboutToBeChanged (const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
 
void layoutChanged (const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
 
void load (int row)
 
void loadAll ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const
 
virtual const QMetaObjectmetaObject () const
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
bool moveColumn (const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild)
 
virtual bool moveColumns (const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild)
 
bool moveRow (const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild)
 
virtual bool moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
 
void moveToThread (QThread *targetThread)
 
int nodeCount () const
 
QString objectName () const
 
void objectNameChanged (const QString &objectName)
 
ParameterList parameters ()
 
virtual QModelIndex parent (const QModelIndex &index) const =0
 
QObjectparent () const
 
QSqlIndex primaryKey () const
 
void primeInsert (int row, QSqlRecord &record)
 
QVariant property (const char *name) const
 
QSqlQuery query () const
 
QSqlRecord record () const
 
QSqlRecord record (int row) const
 
QSqlRelation relation (int column) const
 
virtual QSqlTableModelrelationModel (int column) const
 
void removeChild (int index)
 
bool removeColumn (int column, const QModelIndex &parent)
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
void removeEventFilter (QObject *obj)
 
bool removeRow (int row, const QModelIndex &parent)
 
virtual bool removeRows (int row, int count, const QModelIndex &parent)
 
virtual void revert ()
 
void revertAll ()
 
virtual void revertRow (int row)
 
virtual QHash< int, QByteArrayroleNames () const
 
virtual int rowCount (const QModelIndex &parent) const
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 
void rowsMoved (const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
 
void rowsRemoved (const QModelIndex &parent, int first, int last)
 
bool save ()
 
bool select ()
 
virtual bool selectRow (int row)
 
virtual QString selectStatement () const
 
void set (ParameterList params)
 
void setColumnRole (int column, int role, QVariant value)
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
virtual void setEditStrategy (EditStrategy strategy)
 
virtual void setFilter (const QString &filter)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
void setJoinMode (QSqlRelationalTableModel::JoinMode joinMode)
 
void setKeys (int keyColumns)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
void setQuery (const QString &query, const QSqlDatabase &db)
 
bool setRecord (int row, const QSqlRecord &values)
 
virtual void setRelation (int column, const QSqlRelation &relation)
 
virtual void setSort (int column, Qt::SortOrder order)
 
void setSupportedDragActions (Qt::DropActions actions)
 
void setTable (const QString &tableName)
 
virtual QModelIndex sibling (int row, int column, const QModelIndex &idx) const
 
bool signalsBlocked () const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const
 
int startTimer (int interval, Qt::TimerType timerType)
 
virtual bool submit ()
 
bool submitAll ()
 
virtual Qt::DropActions supportedDragActions () const
 
virtual Qt::DropActions supportedDropActions () const
 
QString tableName () const
 
QThreadthread () const
 

Static Public Member Functions

QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
QModelIndex createIndex (int row, int column, quintptr id) const
 
virtual void customEvent (QEvent *event)
 
virtual bool deleteRowFromTable (int row)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
virtual QModelIndex indexInQuery (const QModelIndex &item) const
 
virtual bool insertRowIntoTable (const QSqlRecord &values)
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual QString orderByClause () const
 
QModelIndexList persistentIndexList () const
 
QSqlRecord primaryValues (int row) const
 
virtual void queryChange ()
 
int receivers (const char *signal) const
 
void reset ()
 
void resetInternalData ()
 
QObjectsender () const
 
int senderSignalIndex () const
 
void setLastError (const QSqlError &error)
 
void setPrimaryKey (const QSqlIndex &key)
 
void setQuery (const QSqlQuery &query)
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
virtual void timerEvent (QTimerEvent *event)
 
virtual bool updateRowInTable (int row, const QSqlRecord &values)
 

Member Enumeration Documentation

Enumerator
Money 
Qty 
Curr 
Percent 
Cost 
QtyPer 
SalesPrice 
PurchPrice 
UOMRatio 
ExtPrice 
Weight 
Enumerator
FormatRole 
EditorRole 
MenuRole 

Constructor & Destructor Documentation

XSqlTableModel::XSqlTableModel ( QObject parent = 0)
XSqlTableModel::~XSqlTableModel ( )

Member Function Documentation

void XSqlTableModel::appendChild ( XSqlTableNode child)
inline
XSqlTableNode * XSqlTableModel::appendChild ( const QString tableName,
ParameterList &  relations 
)
void XSqlTableModel::applyColumnRole ( int  column,
int  role,
QVariant  value 
)
void XSqlTableModel::applyColumnRoles ( )
void XSqlTableModel::applyColumnRoles ( int  row)
QString XSqlTableModel::buildFilter ( ParameterList &  params)
ParameterList XSqlTableModel::buildParams ( XSqlTableModel parent,
int  row,
ParameterList  relations 
)
XSqlTableNode* XSqlTableModel::child ( int  index)
inline
XSqlTableNode * XSqlTableModel::child ( const QString tableName)
QList<XSqlTableNode *> XSqlTableModel::children ( )
inline
void XSqlTableModel::clear ( )
virtual

Reimplemented from QSqlRelationalTableModel.

void XSqlTableModel::clearChildren ( )
QVariant XSqlTableModel::data ( const QModelIndex index,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented from QSqlRelationalTableModel.

QVariant XSqlTableModel::formatValue ( const QVariant dataValue,
const QVariant formatValue 
) const
void XSqlTableModel::load ( int  row)
void XSqlTableModel::loadAll ( )
int XSqlTableModel::nodeCount ( ) const
inline
ParameterList XSqlTableModel::parameters ( )
inline
void XSqlTableModel::removeChild ( int  index)
inline
bool XSqlTableModel::save ( )

Saves the current model and all of it's child node models to the database where a\ transact wraps all submissions in a database transaction.

bool XSqlTableModel::select ( )
virtual

Reimplemented from QSqlRelationalTableModel.

QString XSqlTableModel::selectStatement ( ) const
virtual

Reimplemented from QSqlRelationalTableModel.

void XSqlTableModel::set ( ParameterList  params)
inline
void XSqlTableModel::setColumnRole ( int  column,
int  role,
QVariant  value 
)
bool XSqlTableModel::setData ( const QModelIndex index,
const QVariant value,
int  role = Qt::EditRole 
)
virtual

Reimplemented from QSqlRelationalTableModel.

void XSqlTableModel::setKeys ( int  keyColumns)
void XSqlTableModel::setTable ( const QString tableName)
virtual

Reimplemented from QSqlRelationalTableModel.


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

Generated on Wed Nov 30 2016 xTuple ERP Programmer Reference, Version 4.10.0 doxygen 1.8.7