|
|
#ifndef PYTHONQTWRAPPER_QSQLQUERYMODEL_H
|
|
|
#define PYTHONQTWRAPPER_QSQLQUERYMODEL_H
|
|
|
|
|
|
#include <qsqlquerymodel.h>
|
|
|
#include <QObject>
|
|
|
|
|
|
#include <PythonQt.h>
|
|
|
|
|
|
#include <QSize>
|
|
|
#include <QSqlError>
|
|
|
#include <QSqlQuery>
|
|
|
#include <QSqlRecord>
|
|
|
#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 <qsqlquery.h>
|
|
|
#include <qsqlrecord.h>
|
|
|
#include <qstringlist.h>
|
|
|
|
|
|
class PythonQtShell_QSqlQueryModel : public QSqlQueryModel
|
|
|
{
|
|
|
public:
|
|
|
PythonQtShell_QSqlQueryModel(QObject* parent = 0):QSqlQueryModel(parent),_wrapper(NULL) {};
|
|
|
|
|
|
virtual QModelIndex buddy(const QModelIndex& index) const;
|
|
|
virtual bool canFetchMore(const QModelIndex& parent = QModelIndex()) const;
|
|
|
virtual void childEvent(QChildEvent* arg__1);
|
|
|
virtual void clear();
|
|
|
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
|
|
virtual void customEvent(QEvent* arg__1);
|
|
|
virtual QVariant data(const QModelIndex& item, int role = Qt::DisplayRole) const;
|
|
|
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 = QModelIndex());
|
|
|
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 = QModelIndex());
|
|
|
virtual bool insertRows(int row, int count, const QModelIndex& parent);
|
|
|
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 void queryChange();
|
|
|
virtual bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex());
|
|
|
virtual bool removeRows(int row, int count, const QModelIndex& parent);
|
|
|
virtual void revert();
|
|
|
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
|
|
virtual bool setData(const QModelIndex& index, const QVariant& value, int role);
|
|
|
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole);
|
|
|
virtual bool setItemData(const QModelIndex& index, const QMap<int , QVariant >& roles);
|
|
|
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);
|
|
|
|
|
|
PythonQtInstanceWrapper* _wrapper;
|
|
|
};
|
|
|
|
|
|
class PythonQtPublicPromoter_QSqlQueryModel : public QSqlQueryModel
|
|
|
{ public:
|
|
|
inline int promoted_columnCount(const QModelIndex& parent = QModelIndex()) const { return QSqlQueryModel::columnCount(parent); }
|
|
|
inline QVariant promoted_data(const QModelIndex& item, int role = Qt::DisplayRole) const { return QSqlQueryModel::data(item, role); }
|
|
|
inline void promoted_queryChange() { QSqlQueryModel::queryChange(); }
|
|
|
inline bool promoted_setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole) { return QSqlQueryModel::setHeaderData(section, orientation, value, role); }
|
|
|
inline void promoted_fetchMore(const QModelIndex& parent = QModelIndex()) { QSqlQueryModel::fetchMore(parent); }
|
|
|
inline void promoted_clear() { QSqlQueryModel::clear(); }
|
|
|
inline int promoted_rowCount(const QModelIndex& parent = QModelIndex()) const { return QSqlQueryModel::rowCount(parent); }
|
|
|
inline bool promoted_insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) { return QSqlQueryModel::insertColumns(column, count, parent); }
|
|
|
inline bool promoted_removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) { return QSqlQueryModel::removeColumns(column, count, parent); }
|
|
|
inline bool promoted_canFetchMore(const QModelIndex& parent = QModelIndex()) const { return QSqlQueryModel::canFetchMore(parent); }
|
|
|
inline QVariant promoted_headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const { return QSqlQueryModel::headerData(section, orientation, role); }
|
|
|
};
|
|
|
|
|
|
class PythonQtWrapper_QSqlQueryModel : public QObject
|
|
|
{ Q_OBJECT
|
|
|
public:
|
|
|
public slots:
|
|
|
QSqlQueryModel* new_QSqlQueryModel(QObject* parent = 0);
|
|
|
void delete_QSqlQueryModel(QSqlQueryModel* obj) { delete obj; }
|
|
|
int columnCount(QSqlQueryModel* theWrappedObject, const QModelIndex& parent = QModelIndex()) const;
|
|
|
QVariant data(QSqlQueryModel* theWrappedObject, const QModelIndex& item, int role = Qt::DisplayRole) const;
|
|
|
void queryChange(QSqlQueryModel* theWrappedObject);
|
|
|
bool setHeaderData(QSqlQueryModel* theWrappedObject, int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole);
|
|
|
QSqlRecord record(QSqlQueryModel* theWrappedObject) const;
|
|
|
void fetchMore(QSqlQueryModel* theWrappedObject, const QModelIndex& parent = QModelIndex());
|
|
|
void clear(QSqlQueryModel* theWrappedObject);
|
|
|
int rowCount(QSqlQueryModel* theWrappedObject, const QModelIndex& parent = QModelIndex()) const;
|
|
|
void setQuery(QSqlQueryModel* theWrappedObject, const QString& query, const QSqlDatabase& db = QSqlDatabase());
|
|
|
bool insertColumns(QSqlQueryModel* theWrappedObject, int column, int count, const QModelIndex& parent = QModelIndex());
|
|
|
QSqlError lastError(QSqlQueryModel* theWrappedObject) const;
|
|
|
bool removeColumns(QSqlQueryModel* theWrappedObject, int column, int count, const QModelIndex& parent = QModelIndex());
|
|
|
bool canFetchMore(QSqlQueryModel* theWrappedObject, const QModelIndex& parent = QModelIndex()) const;
|
|
|
void setQuery(QSqlQueryModel* theWrappedObject, const QSqlQuery& query);
|
|
|
QVariant headerData(QSqlQueryModel* theWrappedObject, int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
|
|
QSqlQuery query(QSqlQueryModel* theWrappedObject) const;
|
|
|
QSqlRecord record(QSqlQueryModel* theWrappedObject, int row) const;
|
|
|
};
|
|
|
|
|
|
#endif // PYTHONQTWRAPPER_QSQLQUERYMODEL_H
|
|
|
|