List of all members | Public Types | Properties | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static 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 canFetchMore (const QModelIndex &parent) const
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
XSqlTableNodechild (int index)
 
XSqlTableNodechild (const QString &tableName)
 
const QObjectList & children () const
 
QList< XSqlTableNode * > children ()
 
const char * className () const
 
void clear ()
 
void clearChildren ()
 
virtual int columnCount (const QModelIndex &index) const
 
void columnsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void columnsInserted (const QModelIndex &parent, int start, int end)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int start, int end)
 
bool 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)
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *receiver, const char *method)
 
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) const
 
QList< T > findChildren (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) 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
 
void insertChild (QObject *object)
 
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 isA (const char *className) const
 
bool isDirty (const QModelIndex &index) const
 
bool isWidgetType () const
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 
void killTimer (int id)
 
QSqlError lastError () const
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
void load (int row)
 
void loadAll ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
virtual const QMetaObjectmetaObject () const
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
int nodeCount () const
 
QString objectName () const
 
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 (int row) const
 
QSqlRecord record () const
 
QSqlRelation relation (int column) const
 
virtual QSqlTableModelrelationModel (int column) const
 
void removeChild (QObject *object)
 
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)
 
const QHash< int, QByteArray > & roleNames () 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 start, int end)
 
void rowsInserted (const QModelIndex &parent, int start, int end)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int start, int end)
 
bool save ()
 
bool select ()
 
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 setName (const char *name)
 
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 &record)
 
virtual void setRelation (int column, const QSqlRelation &relation)
 
virtual void setSort (int column, Qt::SortOrder order)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
virtual void setTable (const QString &table)
 
void setTable (const QString &tableName, int keyColumns=0)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
bool signalsBlocked () const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const
 
int startTimer (int interval)
 
virtual bool submit ()
 
bool submitAll ()
 
Qt::DropActions supportedDragActions () const
 
virtual Qt::DropActions supportedDropActions () const
 
QString tableName () const
 
QThreadthread () const
 

Static Public Member Functions

bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *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)
 
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
virtual void customEvent (QEvent *event)
 
virtual bool deleteRowFromTable (int row)
 
virtual void disconnectNotify (const char *signal)
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndex indexInQuery (const QModelIndex &item) const
 
virtual bool insertRowIntoTable (const QSqlRecord &values)
 
virtual QString orderByClause () const
 
QModelIndexList persistentIndexList () 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)
 

Static Protected Member Functions

QByteArray normalizeSignalSlot (const char *signalSlot)
 

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,
int  keyColumns = 0 
)

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

Generated on Mon Dec 1 2014 xTuple ERP Programmer Reference, Version 4.8.0 doxygen 1.8.7