PythonQtWrapper_QSqlTableModel.h
149 lines
| 9.2 KiB
| text/x-c
|
CLexer
florianlink
|
r13 | #ifndef PYTHONQTWRAPPER_QSQLTABLEMODEL_H | ||
#define PYTHONQTWRAPPER_QSQLTABLEMODEL_H | ||||
#include <qsqltablemodel.h> | ||||
#include <QObject> | ||||
florianlink
|
r24 | #include <PythonQt.h> | ||
florianlink
|
r13 | #include <QSize> | ||
#include <QSqlIndex> | ||||
#include <QStringList> | ||||
#include <QVariant> | ||||
#include <qabstractitemmodel.h> | ||||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qdatastream.h> | ||||
#include <qlist.h> | ||||
#include <qmimedata.h> | ||||
#include <qobject.h> | ||||
#include <qsize.h> | ||||
#include <qsqldatabase.h> | ||||
#include <qsqlerror.h> | ||||
#include <qsqlindex.h> | ||||
#include <qsqlquery.h> | ||||
#include <qsqlrecord.h> | ||||
#include <qstringlist.h> | ||||
florianlink
|
r24 | class PythonQtShell_QSqlTableModel : public QSqlTableModel | ||
{ | ||||
public: | ||||
PythonQtShell_QSqlTableModel(QObject* parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db),_wrapper(NULL) {}; | ||||
virtual QModelIndex buddy(const QModelIndex& index) const; | ||||
virtual bool canFetchMore(const QModelIndex& parent) const; | ||||
virtual void childEvent(QChildEvent* arg__1); | ||||
virtual void clear(); | ||||
virtual int columnCount(const QModelIndex& parent) const; | ||||
virtual void customEvent(QEvent* arg__1); | ||||
virtual QVariant data(const QModelIndex& idx, int role = Qt::DisplayRole) const; | ||||
virtual bool deleteRowFromTable(int row); | ||||
virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent); | ||||
virtual bool event(QEvent* arg__1); | ||||
virtual bool eventFilter(QObject* arg__1, QEvent* arg__2); | ||||
virtual void fetchMore(const QModelIndex& parent); | ||||
virtual Qt::ItemFlags flags(const QModelIndex& index) const; | ||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; | ||||
virtual QModelIndex index(int row, int column, const QModelIndex& parent) const; | ||||
virtual bool insertColumns(int column, int count, const QModelIndex& parent); | ||||
virtual bool insertRowIntoTable(const QSqlRecord& values); | ||||
virtual bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()); | ||||
virtual QMap<int , QVariant > itemData(const QModelIndex& index) const; | ||||
virtual QList<QModelIndex > match(const QModelIndex& start, int role, const QVariant& value, int hits, Qt::MatchFlags flags) const; | ||||
virtual QMimeData* mimeData(const QList<QModelIndex >& indexes) const; | ||||
virtual QStringList mimeTypes() const; | ||||
virtual QString orderByClause() const; | ||||
virtual void queryChange(); | ||||
virtual bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()); | ||||
virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); | ||||
virtual void revert(); | ||||
virtual void revertRow(int row); | ||||
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; | ||||
virtual bool select(); | ||||
virtual QString selectStatement() const; | ||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); | ||||
virtual void setEditStrategy(QSqlTableModel::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); | ||||
virtual void setSort(int column, Qt::SortOrder order); | ||||
virtual void setTable(const QString& tableName); | ||||
virtual void sort(int column, Qt::SortOrder order); | ||||
virtual QSize span(const QModelIndex& index) const; | ||||
virtual bool submit(); | ||||
virtual Qt::DropActions supportedDropActions() const; | ||||
virtual void timerEvent(QTimerEvent* arg__1); | ||||
virtual bool updateRowInTable(int row, const QSqlRecord& values); | ||||
PythonQtInstanceWrapper* _wrapper; | ||||
}; | ||||
class PythonQtPublicPromoter_QSqlTableModel : public QSqlTableModel | ||||
{ public: | ||||
florianlink
|
r73 | inline QString promoted_selectStatement() const { return QSqlTableModel::selectStatement(); } | ||
inline bool promoted_deleteRowFromTable(int row) { return QSqlTableModel::deleteRowFromTable(row); } | ||||
inline bool promoted_select() { return QSqlTableModel::select(); } | ||||
inline void promoted_setTable(const QString& tableName) { QSqlTableModel::setTable(tableName); } | ||||
florianlink
|
r28 | inline int promoted_rowCount(const QModelIndex& parent = QModelIndex()) const { return QSqlTableModel::rowCount(parent); } | ||
florianlink
|
r73 | inline Qt::ItemFlags promoted_flags(const QModelIndex& index) const { return QSqlTableModel::flags(index); } | ||
florianlink
|
r28 | inline bool promoted_insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) { return QSqlTableModel::insertRows(row, count, parent); } | ||
inline void promoted_clear() { QSqlTableModel::clear(); } | ||||
florianlink
|
r73 | inline bool promoted_removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) { return QSqlTableModel::removeColumns(column, count, parent); } | ||
florianlink
|
r28 | inline bool promoted_insertRowIntoTable(const QSqlRecord& values) { return QSqlTableModel::insertRowIntoTable(values); } | ||
florianlink
|
r73 | inline bool promoted_setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) { return QSqlTableModel::setData(index, value, role); } | ||
inline void promoted_setSort(int column, Qt::SortOrder order) { QSqlTableModel::setSort(column, order); } | ||||
inline bool promoted_submit() { return QSqlTableModel::submit(); } | ||||
inline void promoted_setFilter(const QString& filter) { QSqlTableModel::setFilter(filter); } | ||||
inline void promoted_sort(int column, Qt::SortOrder order) { QSqlTableModel::sort(column, order); } | ||||
florianlink
|
r28 | inline QString promoted_orderByClause() const { return QSqlTableModel::orderByClause(); } | ||
florianlink
|
r73 | inline void promoted_revert() { QSqlTableModel::revert(); } | ||
inline void promoted_setEditStrategy(QSqlTableModel::EditStrategy strategy) { QSqlTableModel::setEditStrategy(strategy); } | ||||
inline bool promoted_removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) { return QSqlTableModel::removeRows(row, count, parent); } | ||||
florianlink
|
r28 | inline QVariant promoted_data(const QModelIndex& idx, int role = Qt::DisplayRole) const { return QSqlTableModel::data(idx, role); } | ||
inline QVariant promoted_headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const { return QSqlTableModel::headerData(section, orientation, role); } | ||||
inline void promoted_revertRow(int row) { QSqlTableModel::revertRow(row); } | ||||
florianlink
|
r73 | inline bool promoted_updateRowInTable(int row, const QSqlRecord& values) { return QSqlTableModel::updateRowInTable(row, values); } | ||
florianlink
|
r24 | }; | ||
florianlink
|
r13 | class PythonQtWrapper_QSqlTableModel : public QObject | ||
{ Q_OBJECT | ||||
public: | ||||
Q_ENUMS(EditStrategy ) | ||||
enum EditStrategy{ | ||||
OnFieldChange = QSqlTableModel::OnFieldChange, OnRowChange = QSqlTableModel::OnRowChange, OnManualSubmit = QSqlTableModel::OnManualSubmit}; | ||||
public slots: | ||||
QSqlTableModel* new_QSqlTableModel(QObject* parent = 0, QSqlDatabase db = QSqlDatabase()); | ||||
void delete_QSqlTableModel(QSqlTableModel* obj) { delete obj; } | ||||
florianlink
|
r28 | int fieldIndex(QSqlTableModel* theWrappedObject, const QString& fieldName) const; | ||
QString tableName(QSqlTableModel* theWrappedObject) const; | ||||
florianlink
|
r73 | QString selectStatement(QSqlTableModel* theWrappedObject) const; | ||
bool isDirty(QSqlTableModel* theWrappedObject, const QModelIndex& index) const; | ||||
QSqlIndex primaryKey(QSqlTableModel* theWrappedObject) const; | ||||
florianlink
|
r24 | bool deleteRowFromTable(QSqlTableModel* theWrappedObject, int row); | ||
florianlink
|
r73 | QSqlTableModel::EditStrategy editStrategy(QSqlTableModel* theWrappedObject) const; | ||
bool select(QSqlTableModel* theWrappedObject); | ||||
void setTable(QSqlTableModel* theWrappedObject, const QString& tableName); | ||||
int rowCount(QSqlTableModel* theWrappedObject, const QModelIndex& parent = QModelIndex()) const; | ||||
Qt::ItemFlags flags(QSqlTableModel* theWrappedObject, const QModelIndex& index) const; | ||||
bool insertRows(QSqlTableModel* theWrappedObject, int row, int count, const QModelIndex& parent = QModelIndex()); | ||||
florianlink
|
r28 | void clear(QSqlTableModel* theWrappedObject); | ||
florianlink
|
r73 | bool removeColumns(QSqlTableModel* theWrappedObject, int column, int count, const QModelIndex& parent = QModelIndex()); | ||
bool insertRowIntoTable(QSqlTableModel* theWrappedObject, const QSqlRecord& values); | ||||
florianlink
|
r28 | bool setRecord(QSqlTableModel* theWrappedObject, int row, const QSqlRecord& record); | ||
florianlink
|
r73 | bool setData(QSqlTableModel* theWrappedObject, const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); | ||
void setSort(QSqlTableModel* theWrappedObject, int column, Qt::SortOrder order); | ||||
florianlink
|
r28 | bool insertRecord(QSqlTableModel* theWrappedObject, int row, const QSqlRecord& record); | ||
florianlink
|
r73 | void setFilter(QSqlTableModel* theWrappedObject, const QString& filter); | ||
void sort(QSqlTableModel* theWrappedObject, int column, Qt::SortOrder order); | ||||
florianlink
|
r28 | QString orderByClause(QSqlTableModel* theWrappedObject) const; | ||
florianlink
|
r73 | QSqlDatabase database(QSqlTableModel* theWrappedObject) const; | ||
void setEditStrategy(QSqlTableModel* theWrappedObject, QSqlTableModel::EditStrategy strategy); | ||||
bool removeRows(QSqlTableModel* theWrappedObject, int row, int count, const QModelIndex& parent = QModelIndex()); | ||||
florianlink
|
r24 | QVariant data(QSqlTableModel* theWrappedObject, const QModelIndex& idx, int role = Qt::DisplayRole) const; | ||
QString filter(QSqlTableModel* theWrappedObject) const; | ||||
QVariant headerData(QSqlTableModel* theWrappedObject, int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; | ||||
florianlink
|
r28 | void revertRow(QSqlTableModel* theWrappedObject, int row); | ||
florianlink
|
r73 | bool updateRowInTable(QSqlTableModel* theWrappedObject, int row, const QSqlRecord& values); | ||
florianlink
|
r13 | }; | ||
#endif // PYTHONQTWRAPPER_QSQLTABLEMODEL_H | ||||