diff options
Diffstat (limited to 'sip/qtsql')
-rw-r--r-- | sip/qtsql/copying.sip | 51 | ||||
-rw-r--r-- | sip/qtsql/qdatabrowser.sip | 150 | ||||
-rw-r--r-- | sip/qtsql/qdatatable.sip | 201 | ||||
-rw-r--r-- | sip/qtsql/qdataview.sip | 60 | ||||
-rw-r--r-- | sip/qtsql/qeditorfactory.sip | 55 | ||||
-rw-r--r-- | sip/qtsql/qsql.sip | 80 | ||||
-rw-r--r-- | sip/qtsql/qsqlcursor.sip | 148 | ||||
-rw-r--r-- | sip/qtsql/qsqldatabase.sip | 154 | ||||
-rw-r--r-- | sip/qtsql/qsqldriver.sip | 93 | ||||
-rw-r--r-- | sip/qtsql/qsqleditorfactory.sip | 57 | ||||
-rw-r--r-- | sip/qtsql/qsqlerror.sip | 68 | ||||
-rw-r--r-- | sip/qtsql/qsqlfield.sip | 95 | ||||
-rw-r--r-- | sip/qtsql/qsqlform.sip | 74 | ||||
-rw-r--r-- | sip/qtsql/qsqlindex.sip | 64 | ||||
-rw-r--r-- | sip/qtsql/qsqlpropertymap.sip | 63 | ||||
-rw-r--r-- | sip/qtsql/qsqlquery.sip | 115 | ||||
-rw-r--r-- | sip/qtsql/qsqlrecord.sip | 177 | ||||
-rw-r--r-- | sip/qtsql/qsqlresult.sip | 73 | ||||
-rw-r--r-- | sip/qtsql/qsqlselectcursor.sip | 92 | ||||
-rw-r--r-- | sip/qtsql/qtsqlmod.sip | 88 |
20 files changed, 1958 insertions, 0 deletions
diff --git a/sip/qtsql/copying.sip b/sip/qtsql/copying.sip new file mode 100644 index 0000000..463904b --- /dev/null +++ b/sip/qtsql/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <[email protected]> + +This file is part of PyQt. + +This copy of PyQt is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtsql/qdatabrowser.sip b/sip/qtsql/qdatabrowser.sip new file mode 100644 index 0000000..ff2e4d8 --- /dev/null +++ b/sip/qtsql/qdatabrowser.sip @@ -0,0 +1,150 @@ +// This is the SIP interface definition for QDataBrowser. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QDataBrowser (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delOnCursor</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataBrowser : QWidget +{ +%TypeHeaderCode +#include <qdatabrowser.h> +%End + +public: + QDataBrowser(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + enum Boundary { + Unknown, + None, + BeforeBeginning, + Beginning, + End, + AfterEnd + }; + + Boundary boundary(); + void setBoundaryChecking(bool); + bool boundaryChecking() const; + + void setSort(const QSqlIndex &); + void setSort(const QStringList &); + QStringList sort() const; + void setFilter(const QString &); + QString filter() const; + + virtual void setSqlCursor(QSqlCursor * /GetWrapper/,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QDataBrowser::setSqlCursor(a0, a1) : sipCpp->setSqlCursor(a0, a1); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a1) + sipTransferTo(a0Wrapper,sipSelf); +%End + + QSqlCursor* sqlCursor() const; + virtual void setForm(QSqlForm *); + QSqlForm* form(); + + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + + virtual void setReadOnly(bool); + bool isReadOnly() const; + virtual void setAutoEdit(bool); + bool autoEdit() const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + +signals: + void firstRecordAvailable(bool); + void lastRecordAvailable(bool); + void nextRecordAvailable(bool); + void prevRecordAvailable(bool); + + void currentChanged(const QSqlRecord *); + void primeInsert(QSqlRecord *); + void primeUpdate(QSqlRecord *); + void primeDelete(QSqlRecord *); + void beforeInsert(QSqlRecord *); + void beforeUpdate(QSqlRecord *); + void beforeDelete(QSqlRecord *); + void cursorChanged(QSqlCursor::Mode); + +public slots: + virtual void refresh(); + + virtual void insert() /ReleaseGIL/; + virtual void update() /ReleaseGIL/; + virtual void del() /PyName=delOnCursor, ReleaseGIL/; + + virtual void first() /ReleaseGIL/; + virtual void last() /ReleaseGIL/; + virtual void next() /ReleaseGIL/; + virtual void prev() /ReleaseGIL/; + + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + + void updateBoundary(); + +protected: + virtual bool insertCurrent() /ReleaseGIL/; + virtual bool updateCurrent() /ReleaseGIL/; + virtual bool deleteCurrent() /ReleaseGIL/; + virtual bool currentEdited(); + + virtual QSql::Confirm confirmEdit(QSql::Op) /ReleaseGIL/; + virtual QSql::Confirm confirmCancel(QSql::Op) /ReleaseGIL/; + + virtual void handleError(const QSqlError &) /ReleaseGIL/; + +private: +%If (Qt_3_1_0 -) + QDataBrowser(const QDataBrowser &); +%End +}; + +%End diff --git a/sip/qtsql/qdatatable.sip b/sip/qtsql/qdatatable.sip new file mode 100644 index 0000000..bcb0290 --- /dev/null +++ b/sip/qtsql/qdatatable.sip @@ -0,0 +1,201 @@ +// This is the SIP interface definition for QDataTable. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QDataTable (Qt v3+)</Title> +<Para> +<Literal>QDataTable</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataTable : QTable +{ +%TypeHeaderCode +#include <qdatatable.h> +%End + +public: + QDataTable(QWidget* /TransferThis/ = 0,const char * = 0); + QDataTable(QSqlCursor *,bool = 0,QWidget * /TransferThis/ = 0, + const char * = 0); + + virtual void addColumn(const QString &,const QString & = QString::null, + int = -1,const QIconSet & = QIconSet()); + virtual void removeColumn(uint); + virtual void setColumn(uint,const QString &, + const QString & = QString::null,int = -1, + const QIconSet & = QIconSet()); + + QString nullText() const; + QString trueText() const; + QString falseText() const; + DateFormat dateFormat() const; + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + bool autoDelete() const; + bool autoEdit() const; + QString filter() const; + QStringList sort() const; + + virtual void setSqlCursor(QSqlCursor * /GetWrapper/ = 0,bool = 0,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QDataTable::setSqlCursor(a0, a1, a2) : sipCpp->setSqlCursor(a0, a1, a2); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a2) + sipTransferTo(a0Wrapper,sipSelf); +%End + + QSqlCursor *sqlCursor() const; + + virtual void setNullText(const QString &); + virtual void setTrueText(const QString &); + virtual void setFalseText(const QString &); + virtual void setDateFormat(const DateFormat); + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + virtual void setAutoDelete(bool); + virtual void setAutoEdit(bool); + virtual void setFilter(const QString &); + virtual void setSort(const QStringList &); + virtual void setSort(const QSqlIndex &); + + enum Refresh { + RefreshData, + RefreshColumns, + RefreshAll + }; + + void refresh(Refresh); + void sortColumn(int,bool = 1,bool = 0); + QString text(int,int) const; + QVariant value(int,int) const; + QSqlRecord *currentRecord() const; + + void installEditorFactory(QSqlEditorFactory * /Transfer/); + void installPropertyMap(QSqlPropertyMap * /Transfer/); + + int numCols() const; + int numRows() const; + void setNumCols(int); + void setNumRows(int); + bool findBuffer(const QSqlIndex &,int = 0); + +%If (Qt_3_2_0 -) + void hideColumn(int); + void showColumn(int); +%End + +signals: + void currentChanged(QSqlRecord *); + void primeInsert(QSqlRecord *); + void primeUpdate(QSqlRecord *); + void primeDelete(QSqlRecord *); + void beforeInsert(QSqlRecord *); + void beforeUpdate(QSqlRecord *); + void beforeDelete(QSqlRecord *); + void cursorChanged(QSql::Op); + +public slots: + virtual void find(const QString &,bool,bool); + virtual void sortAscending(int); + virtual void sortDescending(int); + virtual void refresh(); + void setColumnWidth(int,int); +%If (Qt_3_0_5 -) + void adjustColumn(int); + void setColumnStretchable(int,bool); +%End +%If (Qt_3_1_0 -) + void swapColumns(int,int,bool = 0); +%End + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + + virtual QSql::Confirm confirmEdit(QSql::Op); + virtual QSql::Confirm confirmCancel(QSql::Op); + + virtual void handleError(const QSqlError &); + + virtual bool beginInsert(); + virtual QWidget *beginUpdate(int,int,bool); + + bool eventFilter(QObject *,QEvent *); +%If (Qt_3_2_0 -) + void keyPressEvent(QKeyEvent *); +%End + void resizeEvent(QResizeEvent *); + void contentsMousePressEvent(QMouseEvent *); + void contentsContextMenuEvent(QContextMenuEvent *); + void endEdit(int,int,bool,bool); + + // We don't specify /Factory/ for this because the returned QWidget + // will always have a parent which will own it. + QWidget *createEditor(int,int,bool) const; + + void activateNextCell(); + int indexOf(uint) const; + void reset(); + void setSize(QSqlCursor *); + void repaintCell(int,int); + void paintCell(QPainter *,int,int,const QRect &,bool, + const QColorGroup &); + virtual void paintField(QPainter *,const QSqlField *,const QRect &, + bool); +%If (Qt_3_1_0 -) + void drawContents(QPainter *,int,int,int,int); +%End + virtual int fieldAlignment(const QSqlField *); + void columnClicked(int); + void resizeData(int); + + QTableItem *item(int,int) const; + void setItem(int,int,QTableItem *); + void clearCell(int,int); + void setPixmap(int,int,const QPixmap &); + void takeItem(QTableItem *); + +private: + QWidget *beginEdit(int,int,bool); + +%If (Qt_3_1_0 -) + QDataTable(const QDataTable &); +%End +}; + +%End diff --git a/sip/qtsql/qdataview.sip b/sip/qtsql/qdataview.sip new file mode 100644 index 0000000..e6bb36e --- /dev/null +++ b/sip/qtsql/qdataview.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for QDataView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QDataView (Qt v3+)</Title> +<Para> +<Literal>QDataView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataView : QWidget +{ +%TypeHeaderCode +#include <qdataview.h> +%End + +public: + QDataView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void setForm(QSqlForm *); + QSqlForm *form(); + virtual void setRecord(QSqlRecord *); + QSqlRecord *record(); + +public slots: + virtual void refresh(QSqlRecord *); + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + +private: +%If (Qt_3_1_0 -) + QDataView(const QDataView &); +%End +}; + +%End diff --git a/sip/qtsql/qeditorfactory.sip b/sip/qtsql/qeditorfactory.sip new file mode 100644 index 0000000..49f932b --- /dev/null +++ b/sip/qtsql/qeditorfactory.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for QEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QEditorFactory : QObject +{ +%TypeHeaderCode +#include <qeditorfactory.h> +%End + +public: + QEditorFactory(QObject * /TransferThis/ = 0,const char * = 0); + + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QVariant &) /Factory/; + + static QEditorFactory *defaultFactory(); + static void installDefaultFactory(QEditorFactory * /Transfer/); + +private: +%If (Qt_3_1_0 -) + QEditorFactory(const QEditorFactory &); +%End +}; + +%End diff --git a/sip/qtsql/qsql.sip b/sip/qtsql/qsql.sip new file mode 100644 index 0000000..f2df075 --- /dev/null +++ b/sip/qtsql/qsql.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for QSql. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSql (Qt v3+)</Title> +<Para> +<Literal>QSql</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSql +{ +%TypeHeaderCode +#include <qsql.h> +%End + +public: + QSql(); + + enum Op { + None, + Insert, + Update, + Delete + }; + + enum Location { + BeforeFirst, + AfterLast + }; + + enum Confirm { + Cancel, + No, + Yes + }; + +%If (Qt_3_2_0 -) + enum ParameterType { + In, + Out, + InOut + }; + + enum TableType { + Tables, + SystemTables, + Views, + AllTables + }; +%End + +private: + QSql(const QSql &); +}; + +%End diff --git a/sip/qtsql/qsqlcursor.sip b/sip/qtsql/qsqlcursor.sip new file mode 100644 index 0000000..2e11c1b --- /dev/null +++ b/sip/qtsql/qsqlcursor.sip @@ -0,0 +1,148 @@ +// This is the SIP interface definition for QSqlCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlCursor (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>const QString &<Parameter>filter</Parameter></ParamDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlCursor : QSqlRecord, QSqlQuery +{ +%TypeHeaderCode +#include <qsqlcursor.h> +%End + +public: + QSqlCursor(const QString & = QString::null,bool = 1,QSqlDatabase * = 0); + QSqlCursor(const QSqlCursor &); + + enum Mode { + ReadOnly, + Insert, + Update, + Delete, + Writable + }; + + QVariant value(int) const; + QVariant value(const QString &) const; +%If (Qt_3_1_0 -) + void setValue(int,const QVariant &); + void setValue(const QString &,const QVariant &); +%End + virtual QSqlIndex primaryIndex(bool = 1) const; + virtual QSqlIndex index(const QStringList &) const; + QSqlIndex index(const QString &) const; +// QSqlIndex index(const char *) const; + virtual void setPrimaryIndex(const QSqlIndex &); + + virtual void append(const QSqlFieldInfo &); + virtual void insert(int,const QSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const QString &,bool); + void setGenerated(int,bool); + + virtual QSqlRecord *editBuffer(bool = 0); + virtual QSqlRecord *primeInsert(); + virtual QSqlRecord *primeUpdate(); + virtual QSqlRecord *primeDelete(); + virtual int insert(bool = 1) /ReleaseGIL/; + virtual int update(bool = 1) /ReleaseGIL/; + virtual int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual void setMode(int); + int mode() const; + virtual void setCalculated(const QString &,bool); + bool isCalculated(const QString &) const; + virtual void setTrimmed(const QString &,bool); + bool isTrimmed(const QString &) const; + + bool isReadOnly() const; + bool canInsert() const; + bool canUpdate() const; + bool canDelete() const; + + bool select() /ReleaseGIL/; + bool select(const QSqlIndex &) /ReleaseGIL/; + bool select(const QSqlIndex &,const QSqlIndex &) /ReleaseGIL/; + virtual bool select(const QString &,const QSqlIndex & = QSqlIndex()) /ReleaseGIL/; + + virtual void setSort(const QSqlIndex &); + QSqlIndex sort() const; + virtual void setFilter(const QString &); + QString filter() const; + virtual void setName(const QString &,bool = 1); + QString name() const; + QString toString(const QString & = QString::null, + const QString & = ",") const; + +%If (Qt_3_1_0 -) + bool isNull(int) const; + bool isNull(const QString &) const; +%End + +protected: + void afterSeek(); + bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + + virtual QVariant calculateField(const QString &); + virtual int update(const QString &,bool = 1); + virtual int del(const QString &,bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual QString toString(const QString &,QSqlField *, + const QString &) const; + virtual QString toString(QSqlRecord *,const QString &,const QString &, + const QString &) const; + virtual QString toString(const QSqlIndex &,QSqlRecord *, + const QString &,const QString &, + const QString &) const; +}; + +%End diff --git a/sip/qtsql/qsqldatabase.sip b/sip/qtsql/qsqldatabase.sip new file mode 100644 index 0000000..510499f --- /dev/null +++ b/sip/qtsql/qsqldatabase.sip @@ -0,0 +1,154 @@ +// This is the SIP interface definition for QSqlDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlDatabase (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QSqlQuery <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter> = QString::null</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execStatement</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlDatabase : QObject +{ +%TypeHeaderCode +#include <qsqldatabase.h> +%End + +public: +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QSqlDriver, &sipClass_QSqlDriver, -1, 1}, + {sipName_QEditorFactory, &sipClass_QEditorFactory, 7, 2}, + {sipName_QSqlDatabase, &sipClass_QSqlDatabase, -1, 3}, + {sipName_QSqlForm, &sipClass_QSqlForm, -1, 4}, + {sipName_QDataView, &sipClass_QDataView, -1, 5}, + {sipName_QDataTable, &sipClass_QDataTable, -1, 6}, + {sipName_QDataBrowser, &sipClass_QDataBrowser, -1, -1}, + {sipName_QSqlEditorFactory, &sipClass_QSqlEditorFactory, -1, -1}, + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + bool open() /ReleaseGIL/; + bool open(const QString &,const QString &) /ReleaseGIL/; + void close(); + bool isOpen() const; + bool isOpenError() const; + QStringList tables() const; +%If (Qt_3_2_0 -) + QStringList tables(QSql::TableType) const; +%End + QSqlIndex primaryIndex(const QString &) const; + QSqlRecord record(const QString &) const; + QSqlRecord record(const QSqlQuery &) const; + QSqlRecordInfo recordInfo(const QString &) const; + QSqlRecordInfo recordInfo(const QSqlQuery &) const; + QSqlQuery exec(const QString & = QString::null) const /PyName=execStatement, ReleaseGIL/; + QSqlError lastError() const; + + bool transaction(); + bool commit(); + bool rollback(); + + virtual void setDatabaseName(const QString &); + virtual void setUserName(const QString &); + virtual void setPassword(const QString &); + virtual void setHostName(const QString &); + virtual void setPort(int); +%If (Qt_3_2_0 -) + void setConnectOptions(const QString & = QString::null); +%End + QString databaseName() const; + QString userName() const; + QString password() const; + QString hostName() const; + QString driverName() const; + int port() const; +%If (Qt_3_2_0 -) + QString connectOptions() const; +%End + + QSqlDriver *driver() const; + + static QSqlDatabase *addDatabase(const QString &, + const QString & = QString(QSqlDatabase::defaultConnection)); +%If (Qt_3_2_0 -) + static QSqlDatabase *addDatabase(QSqlDriver *, + const QString & = QString(QSqlDatabase::defaultConnection)); +%End + static QSqlDatabase *database(const QString & = QString(QSqlDatabase::defaultConnection),bool = 1); + static void removeDatabase(const QString &); +%If (Qt_3_2_0 -) + static void removeDatabase(QSqlDatabase *); +%End + static bool contains(const QString & = QString(QSqlDatabase::defaultConnection)); + static QStringList drivers(); +// static void registerSqlDriver(const QString &, +// const QSqlDriverCreatorBase *); +%If (Qt_3_2_0 -) + static bool isDriverAvailable(const QString &); +%End + +protected: + QSqlDatabase(const QString &,const QString &, + QObject * /TransferThis/ = 0,const char * = 0); +%If (Qt_3_2_0 -) + QSqlDatabase(QSqlDriver *,QObject * /TransferThis/ = 0, + const char * = 0); +%End + +private: +%If (Qt_3_1_0 -) + QSqlDatabase(const QSqlDatabase &); +%End +}; + +%End diff --git a/sip/qtsql/qsqldriver.sip b/sip/qtsql/qsqldriver.sip new file mode 100644 index 0000000..3ebdaa9 --- /dev/null +++ b/sip/qtsql/qsqldriver.sip @@ -0,0 +1,93 @@ +// This is the SIP interface definition for QSqlDriver. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlDriver (Qt v3+)</Title> +<Para> +<Literal>QSqlDriver</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlDriver : QObject +{ +%TypeHeaderCode +#include <qsqldriver.h> +%End + +public: + enum DriverFeature { + Transactions, + QuerySize, + BLOB, +%If (Qt_3_1_0 -) + Unicode, + PreparedQueries, + NamedPlaceholders, + PositionalPlaceholders +%End + }; + + QSqlDriver(QObject * /TransferThis/ = 0,const char * = 0); + + bool isOpen() const; + bool isOpenError() const; + + virtual bool beginTransaction(); + virtual bool commitTransaction(); + virtual bool rollbackTransaction(); + virtual QStringList tables(const QString &) const; + virtual QSqlIndex primaryIndex(const QString &) const; + virtual QSqlRecord record(const QString &) const; + virtual QSqlRecord record(const QSqlQuery &) const; + virtual QSqlRecordInfo recordInfo(const QString &) const; + virtual QSqlRecordInfo recordInfo(const QSqlQuery &) const; + virtual QString nullText() const; + virtual QString formatValue(const QSqlField *,bool = 0) const; + QSqlError lastError() const; + + virtual bool hasFeature(DriverFeature) const = 0; + virtual bool open(const QString &,const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null, + int = -1) = 0 /ReleaseGIL/; + virtual void close() = 0; + virtual QSqlQuery createQuery() const = 0; + +%If (Qt_3_2_0 -) + bool open(const QString &,const QString &,const QString &, + const QString &,int,const QString &) /ReleaseGIL/; +%End + +protected: + virtual void setOpen(bool); + virtual void setOpenError(bool); + virtual void setLastError(const QSqlError &); + +private: + QSqlDriver(const QSqlDriver &); +}; + +%End diff --git a/sip/qtsql/qsqleditorfactory.sip b/sip/qtsql/qsqleditorfactory.sip new file mode 100644 index 0000000..af93bd4 --- /dev/null +++ b/sip/qtsql/qsqleditorfactory.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QSqlEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QSqlEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlEditorFactory : QEditorFactory +{ +%TypeHeaderCode +#include <qsqleditorfactory.h> +%End + +public: + QSqlEditorFactory(QObject * /TransferThis/ = 0,const char * = 0); + + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QVariant &) /Factory/; + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QSqlField *) /Factory/; + + static QSqlEditorFactory *defaultFactory(); + static void installDefaultFactory(QSqlEditorFactory * /Transfer/); + +private: +%If (Qt_3_1_0 -) + QSqlEditorFactory(const QSqlEditorFactory &); +%End +}; + +%End diff --git a/sip/qtsql/qsqlerror.sip b/sip/qtsql/qsqlerror.sip new file mode 100644 index 0000000..17f9504 --- /dev/null +++ b/sip/qtsql/qsqlerror.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for QSqlError. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlError (Qt v3+)</Title> +<Para> +<Literal>QSqlError</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlError +{ +%TypeHeaderCode +#include <qsqlerror.h> +%End + +public: + enum Type { + None, + Connection, + Statement, + Transaction, + Unknown + }; + + QSqlError(const QString & = QString::null, + const QString & = QString::null,int = QSqlError::None, + int = -1); + QSqlError(const QSqlError &); + + QString driverText() const; + virtual void setDriverText(const QString &); + QString databaseText() const; + virtual void setDatabaseText(const QString &); + int type() const; + virtual void setType(int); + int number() const; + virtual void setNumber(int); +%If (Qt_3_2_0 -) + QString text() const; + void showMessage(const QString & = QString::null) const; +%End +}; + +%End diff --git a/sip/qtsql/qsqlfield.sip b/sip/qtsql/qsqlfield.sip new file mode 100644 index 0000000..39dc046 --- /dev/null +++ b/sip/qtsql/qsqlfield.sip @@ -0,0 +1,95 @@ +// This is the SIP interface definition for QSqlField and QSqlFieldInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlField (Qt v3+)</Title> +<Para> +<Literal>QSqlField</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlFieldInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlFieldInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlField +{ +%TypeHeaderCode +#include <qsqlfield.h> +%End + +public: + QSqlField(const QString & = QString::null, + QVariant::Type = QVariant::Invalid ); + QSqlField(const QSqlField &); + + virtual void setValue(const QVariant &); + virtual QVariant value() const; + virtual void setName(const QString &); + QString name() const; + virtual void setNull(); + bool isNull() const; + virtual void setReadOnly(bool); + bool isReadOnly() const; + void clear(bool = 1); + QVariant::Type type() const; +}; + + +class QSqlFieldInfo +{ +%TypeHeaderCode +#include <qsqlfield.h> +%End + +public: + QSqlFieldInfo(const QString & = QString::null, + QVariant::Type = QVariant::Invalid,int = -1,int = -1, + int = -1,const QVariant & = QVariant(),int = 0,bool = 1, + bool = 0,bool = 0); + QSqlFieldInfo(const QSqlFieldInfo &); + QSqlFieldInfo(const QSqlField &,bool = 1); + + QSqlField toField() const; + int isRequired() const; + QVariant::Type type() const; + int length() const; + int precision() const; + QVariant defaultValue() const; + QString name() const; + int typeID() const; + bool isGenerated() const; + bool isTrim() const; + bool isCalculated() const; + + virtual void setTrim(bool); + virtual void setGenerated(bool); + virtual void setCalculated(bool); +}; + +%End diff --git a/sip/qtsql/qsqlform.sip b/sip/qtsql/qsqlform.sip new file mode 100644 index 0000000..84e05b7 --- /dev/null +++ b/sip/qtsql/qsqlform.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for QSqlForm. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlForm (Qt v3+)</Title> +<Para> +<Literal>QSqlForm</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlForm : QObject +{ +%TypeHeaderCode +#include <qsqlform.h> +%End + +public: + QSqlForm(QObject * /TransferThis/ = 0,const char * = 0); + + virtual void insert(QWidget *,const QString &); + virtual void remove(const QString &); + uint count() const; + + QWidget *widget(uint) const; + QSqlField *widgetToField(QWidget *) const; + QWidget *fieldToWidget(QSqlField *) const; + + void installPropertyMap(QSqlPropertyMap * /Transfer/); + + virtual void setRecord(QSqlRecord *); + +public slots: + virtual void readField(QWidget *); + virtual void writeField(QWidget *); + virtual void readFields(); + virtual void writeFields(); + + virtual void clear(); + virtual void clearValues(bool = 0); + +protected: + virtual void insert(QWidget *,QSqlField *); + virtual void remove(QWidget *); + +private: +%If (Qt_3_1_0 -) + QSqlForm(const QSqlForm &); +%End +}; + +%End diff --git a/sip/qtsql/qsqlindex.sip b/sip/qtsql/qsqlindex.sip new file mode 100644 index 0000000..af88129 --- /dev/null +++ b/sip/qtsql/qsqlindex.sip @@ -0,0 +1,64 @@ +// This is the SIP interface definition for QSqlIndex. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlIndex (Qt v3+)</Title> +<Para> +<Literal>QSqlIndex</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlIndex : QSqlRecord +{ +%TypeHeaderCode +#include <qsqlindex.h> +%End + +public: + QSqlIndex(const QString & = QString::null, + const QString & = QString::null); + QSqlIndex(const QSqlIndex &); + + virtual void setCursorName(const QString &); + QString cursorName() const; + virtual void setName(const QString &); + QString name() const; + + void append(const QSqlField &); + virtual void append(const QSqlField &,bool); + + bool isDescending(int) const; + virtual void setDescending(int,bool); + + QString toString(const QString & = QString::null,const QString & = ",", + bool = 1) const; + QStringList toStringList(const QString & = QString::null, + bool = 1) const; + + static QSqlIndex fromStringList(const QStringList &,const QSqlCursor *); +}; + +%End diff --git a/sip/qtsql/qsqlpropertymap.sip b/sip/qtsql/qsqlpropertymap.sip new file mode 100644 index 0000000..c2f8ae8 --- /dev/null +++ b/sip/qtsql/qsqlpropertymap.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QSqlPropertyMap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlPropertyMap (Qt v3+)</Title> +<Para> +<Literal>QSqlPropertyMap</Literal> is fully implemented. However, because PyQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. These will +simply be ignored. +</Para> + +<Para> +This problem may be addressed in a future release of PyQt. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlPropertyMap +{ +%TypeHeaderCode +#include <qsqlpropertymap.h> +%End + +public: + QSqlPropertyMap(); + + QVariant property(QWidget *); + virtual void setProperty(QWidget *,const QVariant &); + + void insert(const QString &,const QString &); + void remove(const QString &); + + static QSqlPropertyMap *defaultMap(); + static void installDefaultMap(QSqlPropertyMap * /Transfer/); + +private: + QSqlPropertyMap(const QSqlPropertyMap &); +}; + +%End diff --git a/sip/qtsql/qsqlquery.sip b/sip/qtsql/qsqlquery.sip new file mode 100644 index 0000000..a7284f1 --- /dev/null +++ b/sip/qtsql/qsqlquery.sip @@ -0,0 +1,115 @@ +// This is the SIP interface definition for QSqlQuery. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlQuery (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QMap<QString,QVariant> <Function>boundValues</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3.2.0+) +</Para> + +<FuncSynopsis> + <FuncDef>virtual bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. (Qt v3.1+) +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlQuery +{ +%TypeHeaderCode +#include <qsqlquery.h> +%End + +public: + QSqlQuery(QSqlResult *); + QSqlQuery(const QString & = QString::null,QSqlDatabase * = 0); +%If (Qt_3_2_0 -) + QSqlQuery(QSqlDatabase *); +%End + QSqlQuery(const QSqlQuery &); + + bool isValid() const; + bool isActive() const; + bool isNull(int) const; + int at() const; + QString lastQuery() const; + int numRowsAffected() const; + QSqlError lastError() const; + bool isSelect() const; + int size() const; + const QSqlDriver *driver() const; + const QSqlResult *result() const; +%If (Qt_3_1_0 -) + bool isForwardOnly() const; + void setForwardOnly(bool); +%End + + virtual bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + virtual QVariant value(int) const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + virtual bool next() /ReleaseGIL/; + virtual bool prev() /ReleaseGIL/; + virtual bool first() /ReleaseGIL/; + virtual bool last() /ReleaseGIL/; + +%If (Qt_3_1_0 -) + bool exec() /PyName=execQuery, ReleaseGIL/; + bool prepare(const QString &); + void bindValue(const QString &,const QVariant &); + void bindValue(int,const QVariant &); + void addBindValue(const QVariant &); +%End +%If (Qt_3_2_0 -) + void bindValue(const QString &,const QVariant &,QSql::ParameterType); + void bindValue(int,const QVariant &,QSql::ParameterType); + void addBindValue(const QVariant &,QSql::ParameterType); + QVariant boundValue(const QString &) const; + QVariant boundValue(int) const; +// QMap<QString,QVariant> boundValues() const; + QString executedQuery() const; +%End + +protected: + virtual void beforeSeek(); + virtual void afterSeek(); +}; + +%End diff --git a/sip/qtsql/qsqlrecord.sip b/sip/qtsql/qsqlrecord.sip new file mode 100644 index 0000000..5676bcc --- /dev/null +++ b/sip/qtsql/qsqlrecord.sip @@ -0,0 +1,177 @@ +// This is the SIP interface definition for QSqlRecord and QSqlRecordInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlRecord (Qt v3+)</Title> +<Para> +<Literal>QSqlRecord</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlRecordInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlRecordInfo</Literal> is implemented as a Python list of +<Literal>QSqlFieldInfo</Literal> instances. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlRecord +{ +%TypeHeaderCode +#include <qsqlrecord.h> +%End + +public: + QSqlRecord(); + QSqlRecord(const QSqlRecord &); + + virtual QVariant value(int) const; + virtual QVariant value(const QString &) const; + virtual void setValue(int,const QVariant &); + virtual void setValue(const QString &,const QVariant &); + bool isGenerated(int) const; + bool isGenerated(const QString &) const; + virtual void setGenerated(const QString &,bool); + virtual void setGenerated(int,bool); + virtual void setNull(int); + virtual void setNull(const QString &); + bool isNull(int); + bool isNull(const QString &); +%If (Qt_3_1_0 -) +// bool isNull(int) const; +// bool isNull(const QString &) const; +%End + + int position(const QString &) const; + QString fieldName(int) const; + QSqlField *field(int); + QSqlField *field(const QString &); +// const QSqlField *field(int) const; +// const QSqlField *field(const QString &) const; + + virtual void append(const QSqlField &); + virtual void insert(int,const QSqlField &); + virtual void remove(int); + + bool isEmpty() const; + bool contains(const QString &) const; + virtual void clear(); + virtual void clearValues(bool = 0); + uint count() const; + virtual QString toString(const QString & = QString::null, + const QString & = ",") const; + virtual QStringList toStringList(const QString & = QString::null) const; +}; + + +%MappedType QSqlRecordInfo +{ +%TypeHeaderCode +#include <qsqlrecord.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of QSqlFieldInfo instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<QSqlFieldInfo> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new QSqlFieldInfo(*it),sipClass_QSqlFieldInfo,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + + +%ConvertToTypeCode + // Convert a Python list of QSqlFieldInfo instances to a QSqlRecordInfo + // on the heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QSqlFieldInfo,SIP_NOT_NONE)) + return 0; + + return 1; + } + + QSqlRecordInfo *qri = new QSqlRecordInfo; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int iserr = 0, state; + + // We apply the transfer to the list itself, not the elements. + QSqlFieldInfo *itm = reinterpret_cast<QSqlFieldInfo *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QSqlFieldInfo,0,SIP_NOT_NONE,&state,&iserr)); + + if (iserr) + { + sipReleaseInstance(itm,sipClass_QSqlFieldInfo,state); + + *sipIsErr = 1; + delete qri; + + return 0; + } + + qri -> append(*itm); + + sipReleaseInstance(itm,sipClass_QSqlFieldInfo,state); + } + + *sipCppPtr = qri; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/sip/qtsql/qsqlresult.sip b/sip/qtsql/qsqlresult.sip new file mode 100644 index 0000000..f4fc7f6 --- /dev/null +++ b/sip/qtsql/qsqlresult.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for QSqlResult. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlResult (Qt v3+)</Title> +<Para> +<Literal>QSqlResult</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlResult +{ +%TypeHeaderCode +#include <qsqlresult.h> +%End + +protected: + QSqlResult(const QSqlDriver *); + + int at() const; + QString lastQuery() const; + QSqlError lastError() const; + bool isValid() const; + bool isActive() const; + bool isSelect() const; + bool isForwardOnly() const; + const QSqlDriver *driver() const; + virtual void setAt(int); + virtual void setActive(bool); + virtual void setLastError(const QSqlError &); + virtual void setQuery(const QString &); + virtual void setSelect(bool); + virtual void setForwardOnly(bool); + + virtual QVariant data(int) = 0; + virtual bool isNull(int) = 0; + virtual bool reset(const QString &) = 0; + virtual bool fetch(int) = 0; + virtual bool fetchNext(); + virtual bool fetchPrev(); + virtual bool fetchFirst() = 0; + virtual bool fetchLast() = 0; + virtual int size() = 0; + virtual int numRowsAffected() = 0; + +private: + QSqlResult(const QSqlResult &); +}; + +%End diff --git a/sip/qtsql/qsqlselectcursor.sip b/sip/qtsql/qsqlselectcursor.sip new file mode 100644 index 0000000..289cc42 --- /dev/null +++ b/sip/qtsql/qsqlselectcursor.sip @@ -0,0 +1,92 @@ +// This is the SIP interface definition for QSqlSelectCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>QSqlSelectCursor (Qt v3.2.0+)</Title> +<FuncSynopsis> + <FuncDef>int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_2_0 -) + +class QSqlSelectCursor : QSqlCursor +{ +%TypeHeaderCode +#include <qsqlselectcursor.h> +%End + +public: + QSqlSelectCursor(const QString & = QString::null,QSqlDatabase * = 0); + QSqlSelectCursor(const QSqlSelectCursor &); + ~QSqlSelectCursor(); + + bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + bool select() /ReleaseGIL/; + +protected: + QSqlIndex primaryIndex(bool = 1) const; + QSqlIndex index(const QStringList &) const; + QSqlIndex index(const QString &) const; +// QSqlIndex index(const char *) const; + void setPrimaryIndex(const QSqlIndex &); + void append(const QSqlFieldInfo &); + void insert(int,const QSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const QString &,bool); + void setGenerated(int,bool); + QSqlRecord *editBuffer(bool = 0); + QSqlRecord *primeInsert(); + QSqlRecord *primeUpdate(); + QSqlRecord *primeDelete(); + int insert(bool = 1) /ReleaseGIL/; + int update(bool = 1) /ReleaseGIL/; + int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + void setMode(int); + + void setSort(const QSqlIndex &); + QSqlIndex sort() const; + void setFilter(const QString &); + QString filter() const; + void setName(const QString &,bool = 1); + QString name() const; + QString toString(const QString & = QString::null, + const QString & = ",") const; + bool select(const QString &,const QSqlIndex & = QSqlIndex()) /ReleaseGIL/; +}; + +%End diff --git a/sip/qtsql/qtsqlmod.sip b/sip/qtsql/qtsqlmod.sip new file mode 100644 index 0000000..f780a9a --- /dev/null +++ b/sip/qtsql/qtsqlmod.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for the qtsql module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <[email protected]> +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%Module qtsql 1 + +%Import qt/qtmod.sip +%Import qttable/qttablemod.sip + +%Include copying.sip + + +%Include qdatabrowser.sip +%Include qdatatable.sip +%Include qdataview.sip +%Include qeditorfactory.sip +%Include qsql.sip +%Include qsqlcursor.sip +%Include qsqldatabase.sip +%Include qsqldriver.sip +%Include qsqleditorfactory.sip +%Include qsqlerror.sip +%Include qsqlfield.sip +%Include qsqlform.sip +%Include qsqlindex.sip +%Include qsqlpropertymap.sip +%Include qsqlquery.sip +%Include qsqlrecord.sip +%Include qsqlresult.sip +%Include qsqlselectcursor.sip + + +// The build file template. + +%Makefile qtsql.pro.in +# The project file for the qtsql module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <[email protected]> +# +# This file is part of PyQt. +# +# This copy of PyQt is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2, or (at your option) any later +# version. +# +# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QTTABLE_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End |