Fix tray visibility and message reception issues
- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Automatically generated configuration for PyQt6.QtSql.
|
||||
|
||||
sip-version = "6.14.0"
|
||||
sip-abi-version = "13.8"
|
||||
module-tags = ["Qt_6_10_0", "Linux"]
|
||||
module-disabled-features = ["PyQt_OpenGL_ES2"]
|
||||
@@ -0,0 +1,61 @@
|
||||
// QtSqlmod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%Module(name=PyQt6.QtSql, keyword_arguments="Optional", use_limited_api=True)
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
%Import QtWidgets/QtWidgetsmod.sip
|
||||
|
||||
%Copying
|
||||
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
||||
This file is part of PyQt6.
|
||||
|
||||
This file may be used under the terms of the GNU General Public License
|
||||
version 3.0 as published by the Free Software Foundation and appearing in
|
||||
the file LICENSE included in the packaging of this file. Please review the
|
||||
following information to ensure the GNU General Public License version 3.0
|
||||
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
then you may purchase a commercial license. For more information contact
|
||||
info@riverbankcomputing.com.
|
||||
|
||||
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
%End
|
||||
|
||||
%DefaultSupertype PyQt6.sip.simplewrapper
|
||||
|
||||
%Include qsqldatabase.sip
|
||||
%Include qsqldriver.sip
|
||||
%Include qsqlerror.sip
|
||||
%Include qsqlfield.sip
|
||||
%Include qsqlindex.sip
|
||||
%Include qsqlquery.sip
|
||||
%Include qsqlquerymodel.sip
|
||||
%Include qsqlrecord.sip
|
||||
%Include qsqlrelationaldelegate.sip
|
||||
%Include qsqlrelationaltablemodel.sip
|
||||
%Include qsqlresult.sip
|
||||
%Include qsqltablemodel.sip
|
||||
%Include qtsqlglobal.sip
|
||||
@@ -0,0 +1,98 @@
|
||||
// qsqldatabase.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlDriverCreatorBase /Supertype=PyQt6.sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqldatabase.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QSqlDriverCreatorBase();
|
||||
virtual QSqlDriver *createObject() const = 0 /Factory/;
|
||||
};
|
||||
|
||||
class QSqlDatabase
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqldatabase.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSqlDatabase();
|
||||
QSqlDatabase(const QSqlDatabase &other);
|
||||
~QSqlDatabase();
|
||||
bool open() /ReleaseGIL/;
|
||||
bool open(const QString &user, const QString &password) /ReleaseGIL/;
|
||||
void close();
|
||||
bool isOpen() const;
|
||||
bool isOpenError() const;
|
||||
QStringList tables(QSql::TableType type = QSql::Tables) const;
|
||||
QSqlIndex primaryIndex(const QString &tablename) const;
|
||||
QSqlRecord record(const QString &tablename) const;
|
||||
QSqlQuery exec(const QString &query = QString()) const /ReleaseGIL/;
|
||||
QSqlError lastError() const;
|
||||
bool isValid() const;
|
||||
bool transaction() /ReleaseGIL/;
|
||||
bool commit() /ReleaseGIL/;
|
||||
bool rollback() /ReleaseGIL/;
|
||||
void setDatabaseName(const QString &name);
|
||||
void setUserName(const QString &name);
|
||||
void setPassword(const QString &password);
|
||||
void setHostName(const QString &host);
|
||||
void setPort(int p);
|
||||
void setConnectOptions(const QString &options = QString());
|
||||
QString databaseName() const;
|
||||
QString userName() const;
|
||||
QString password() const;
|
||||
QString hostName() const;
|
||||
QString driverName() const;
|
||||
int port() const;
|
||||
QString connectOptions() const;
|
||||
QString connectionName() const;
|
||||
QSqlDriver *driver() const;
|
||||
static QSqlDatabase addDatabase(const QString &type, const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
|
||||
static QSqlDatabase addDatabase(QSqlDriver *driver, const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
|
||||
static QSqlDatabase cloneDatabase(const QSqlDatabase &other, const QString &connectionName);
|
||||
static QSqlDatabase cloneDatabase(const QString &other, const QString &connectionName);
|
||||
static QSqlDatabase database(const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection), bool open = true);
|
||||
static void removeDatabase(const QString &connectionName);
|
||||
static bool contains(const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
|
||||
static QStringList drivers();
|
||||
static QStringList connectionNames();
|
||||
static void registerSqlDriver(const QString &name, QSqlDriverCreatorBase *creator /Transfer/);
|
||||
static bool isDriverAvailable(const QString &name);
|
||||
|
||||
protected:
|
||||
explicit QSqlDatabase(const QString &type);
|
||||
explicit QSqlDatabase(QSqlDriver *driver);
|
||||
|
||||
public:
|
||||
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
|
||||
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool moveToThread(QThread *targetThread);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
QThread *thread() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,162 @@
|
||||
// qsqldriver.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlDriver : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqldriver.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
static struct class_graph {
|
||||
const char *name;
|
||||
sipTypeDef **type;
|
||||
int yes, no;
|
||||
} graph[] = {
|
||||
{sipName_QSqlQueryModel, &sipType_QSqlQueryModel, 3, 1},
|
||||
{sipName_QSqlRelationalDelegate, &sipType_QSqlRelationalDelegate, -1, 2},
|
||||
{sipName_QSqlDriver, &sipType_QSqlDriver, -1, -1},
|
||||
{sipName_QSqlTableModel, &sipType_QSqlTableModel, 4, -1},
|
||||
{sipName_QSqlRelationalTableModel, &sipType_QSqlRelationalTableModel, -1, -1},
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
|
||||
sipType = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
struct class_graph *cg = &graph[i];
|
||||
|
||||
if (cg->name != NULL && sipCpp->inherits(cg->name))
|
||||
{
|
||||
sipType = *cg->type;
|
||||
i = cg->yes;
|
||||
}
|
||||
else
|
||||
i = cg->no;
|
||||
}
|
||||
while (i >= 0);
|
||||
%End
|
||||
|
||||
public:
|
||||
enum DriverFeature
|
||||
{
|
||||
Transactions,
|
||||
QuerySize,
|
||||
BLOB,
|
||||
Unicode,
|
||||
PreparedQueries,
|
||||
NamedPlaceholders,
|
||||
PositionalPlaceholders,
|
||||
LastInsertId,
|
||||
BatchOperations,
|
||||
SimpleLocking,
|
||||
LowPrecisionNumbers,
|
||||
EventNotifications,
|
||||
FinishQuery,
|
||||
MultipleResultSets,
|
||||
};
|
||||
|
||||
enum StatementType
|
||||
{
|
||||
WhereStatement,
|
||||
SelectStatement,
|
||||
UpdateStatement,
|
||||
InsertStatement,
|
||||
DeleteStatement,
|
||||
};
|
||||
|
||||
enum IdentifierType
|
||||
{
|
||||
FieldName,
|
||||
TableName,
|
||||
};
|
||||
|
||||
explicit QSqlDriver(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QSqlDriver();
|
||||
virtual bool isOpen() const;
|
||||
bool isOpenError() const;
|
||||
virtual bool beginTransaction() /ReleaseGIL/;
|
||||
virtual bool commitTransaction() /ReleaseGIL/;
|
||||
virtual bool rollbackTransaction() /ReleaseGIL/;
|
||||
virtual QStringList tables(QSql::TableType tableType) const;
|
||||
virtual QSqlIndex primaryIndex(const QString &tableName) const;
|
||||
virtual QSqlRecord record(const QString &tableName) const;
|
||||
virtual QString formatValue(const QSqlField &field, bool trimStrings = false) const;
|
||||
virtual QString escapeIdentifier(const QString &identifier, QSqlDriver::IdentifierType type) const;
|
||||
virtual QString sqlStatement(QSqlDriver::StatementType type, const QString &tableName, const QSqlRecord &rec, bool preparedStatement) const;
|
||||
QSqlError lastError() const;
|
||||
virtual QVariant handle() const;
|
||||
virtual bool hasFeature(QSqlDriver::DriverFeature f) const = 0;
|
||||
virtual void close() = 0;
|
||||
virtual QSqlResult *createResult() const = 0 /Factory/;
|
||||
virtual bool open(const QString &db, const QString &user = QString(), const QString &password = QString(), const QString &host = QString(), int port = -1, const QString &options = QString()) = 0 /ReleaseGIL/;
|
||||
|
||||
protected:
|
||||
virtual void setOpen(bool o);
|
||||
virtual void setOpenError(bool e);
|
||||
virtual void setLastError(const QSqlError &e);
|
||||
|
||||
public:
|
||||
virtual bool subscribeToNotification(const QString &name);
|
||||
virtual bool unsubscribeFromNotification(const QString &name);
|
||||
virtual QStringList subscribedToNotifications() const;
|
||||
|
||||
enum NotificationSource
|
||||
{
|
||||
UnknownSource,
|
||||
SelfSource,
|
||||
OtherSource,
|
||||
};
|
||||
|
||||
signals:
|
||||
void notification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload);
|
||||
|
||||
public:
|
||||
virtual bool isIdentifierEscaped(const QString &identifier, QSqlDriver::IdentifierType type) const;
|
||||
virtual QString stripDelimiters(const QString &identifier, QSqlDriver::IdentifierType type) const;
|
||||
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
|
||||
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
|
||||
|
||||
enum DbmsType
|
||||
{
|
||||
UnknownDbms,
|
||||
MSSqlServer,
|
||||
MySqlServer,
|
||||
PostgreSQL,
|
||||
Oracle,
|
||||
Sybase,
|
||||
SQLite,
|
||||
Interbase,
|
||||
DB2,
|
||||
%If (Qt_6_6_0 -)
|
||||
MimerSQL,
|
||||
%End
|
||||
};
|
||||
|
||||
QSqlDriver::DbmsType dbmsType() const;
|
||||
virtual int maximumIdentifierLength(QSqlDriver::IdentifierType type) const;
|
||||
%If (Qt_6_9_0 -)
|
||||
QString connectionName() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
// qsqlerror.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlError
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlerror.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ErrorType
|
||||
{
|
||||
NoError,
|
||||
ConnectionError,
|
||||
StatementError,
|
||||
TransactionError,
|
||||
UnknownError,
|
||||
};
|
||||
|
||||
QSqlError(const QString &driverText = QString(), const QString &databaseText = QString(), QSqlError::ErrorType type = QSqlError::NoError, const QString &errorCode = QString());
|
||||
QSqlError(const QSqlError &other);
|
||||
~QSqlError();
|
||||
QString driverText() const;
|
||||
QString databaseText() const;
|
||||
QSqlError::ErrorType type() const;
|
||||
QString text() const;
|
||||
bool isValid() const;
|
||||
bool operator==(const QSqlError &other) const;
|
||||
bool operator!=(const QSqlError &other) const;
|
||||
QString nativeErrorCode() const;
|
||||
void swap(QSqlError &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,73 @@
|
||||
// qsqlfield.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlField
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlfield.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum RequiredStatus
|
||||
{
|
||||
Unknown,
|
||||
Optional,
|
||||
Required,
|
||||
};
|
||||
|
||||
QSqlField(const QString &fieldName = QString(), QMetaType type = QMetaType(), const QString &tableName = QString());
|
||||
QSqlField(const QSqlField &other);
|
||||
bool operator==(const QSqlField &other) const;
|
||||
bool operator!=(const QSqlField &other) const;
|
||||
~QSqlField();
|
||||
void setValue(const QVariant &value);
|
||||
QVariant value() const;
|
||||
void setName(const QString &name);
|
||||
QString name() const;
|
||||
bool isNull() const;
|
||||
void setReadOnly(bool readOnly);
|
||||
bool isReadOnly() const;
|
||||
void clear();
|
||||
bool isAutoValue() const;
|
||||
void setRequiredStatus(QSqlField::RequiredStatus status);
|
||||
void setRequired(bool required);
|
||||
void setLength(int fieldLength);
|
||||
void setPrecision(int precision);
|
||||
void setDefaultValue(const QVariant &value);
|
||||
void setSqlType(int type);
|
||||
void setGenerated(bool gen);
|
||||
void setAutoValue(bool autoVal);
|
||||
QSqlField::RequiredStatus requiredStatus() const;
|
||||
int length() const;
|
||||
int precision() const;
|
||||
QVariant defaultValue() const;
|
||||
int typeID() const;
|
||||
bool isGenerated() const;
|
||||
bool isValid() const;
|
||||
void setTableName(const QString &tableName);
|
||||
QString tableName() const;
|
||||
QMetaType metaType() const;
|
||||
void setMetaType(QMetaType type);
|
||||
%If (Qt_6_6_0 -)
|
||||
void swap(QSqlField &other /Constrained/);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
// qsqlindex.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlIndex : public QSqlRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlindex.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSqlIndex(const QString &cursorName = QString(), const QString &name = QString());
|
||||
QSqlIndex(const QSqlIndex &other);
|
||||
~QSqlIndex();
|
||||
void setCursorName(const QString &cursorName);
|
||||
QString cursorName() const;
|
||||
void setName(const QString &name);
|
||||
QString name() const;
|
||||
void append(const QSqlField &field);
|
||||
void append(const QSqlField &field, bool desc);
|
||||
bool isDescending(int i) const;
|
||||
void setDescending(int i, bool desc);
|
||||
%If (Qt_6_6_0 -)
|
||||
void swap(QSqlIndex &other /Constrained/);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,105 @@
|
||||
// qsqlquery.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlQuery
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlquery.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum BatchExecutionMode
|
||||
{
|
||||
ValuesAsRows,
|
||||
ValuesAsColumns,
|
||||
};
|
||||
|
||||
explicit QSqlQuery(const QSqlDatabase &db);
|
||||
QSqlQuery(const QString &query = QString(), const QSqlDatabase &db = QSqlDatabase()) /ReleaseGIL/;
|
||||
explicit QSqlQuery(QSqlResult *r);
|
||||
QSqlQuery(const QSqlQuery &other);
|
||||
~QSqlQuery();
|
||||
bool isValid() const;
|
||||
bool isActive() const;
|
||||
bool isNull(int field) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool isNull(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
bool isNull(const QString &name) const;
|
||||
%End
|
||||
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;
|
||||
bool isForwardOnly() const;
|
||||
QSqlRecord record() const;
|
||||
void setForwardOnly(bool forward);
|
||||
bool exec(const QString &query) /ReleaseGIL/;
|
||||
QVariant value(int i) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
QVariant value(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
QVariant value(const QString &name) const;
|
||||
%End
|
||||
bool seek(int index, bool relative = false) /ReleaseGIL/;
|
||||
bool next() /ReleaseGIL/;
|
||||
bool previous() /ReleaseGIL/;
|
||||
bool first() /ReleaseGIL/;
|
||||
bool last() /ReleaseGIL/;
|
||||
void clear() /ReleaseGIL/;
|
||||
bool exec() /ReleaseGIL/;
|
||||
bool execBatch(QSqlQuery::BatchExecutionMode mode = QSqlQuery::ValuesAsRows);
|
||||
bool prepare(const QString &query) /ReleaseGIL/;
|
||||
void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type = QSql::In);
|
||||
void bindValue(int pos, const QVariant &val, QSql::ParamType type = QSql::In);
|
||||
void addBindValue(const QVariant &val, QSql::ParamType type = QSql::In);
|
||||
QVariant boundValue(const QString &placeholder) const;
|
||||
QVariant boundValue(int pos) const;
|
||||
QVariantList boundValues() const;
|
||||
QString executedQuery() const;
|
||||
QVariant lastInsertId() const;
|
||||
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
|
||||
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
|
||||
void finish();
|
||||
bool nextResult();
|
||||
%If (Qt_6_2_0 -)
|
||||
void swap(QSqlQuery &other /Constrained/);
|
||||
%End
|
||||
%If (Qt_6_6_0 -)
|
||||
QStringList boundValueNames() const;
|
||||
%End
|
||||
%If (Qt_6_6_0 -)
|
||||
QString boundValueName(int pos) const;
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
void setPositionalBindingEnabled(bool enable);
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
bool isPositionalBindingEnabled() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
// qsqlquerymodel.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlQueryModel : public QAbstractTableModel
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlquerymodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QSqlQueryModel(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QSqlQueryModel();
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QSqlRecord record() const;
|
||||
QSqlRecord record(int row) const;
|
||||
virtual QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
void setQuery(const QSqlQuery &query);
|
||||
void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase());
|
||||
%If (Qt_6_5_0 -)
|
||||
const QSqlQuery &query() const;
|
||||
%MethodCode
|
||||
sipRes = const_cast<QSqlQuery *>(&sipCpp->query(Qt::Disambiguated));
|
||||
%End
|
||||
|
||||
%End
|
||||
%If (- Qt_6_5_0)
|
||||
QSqlQuery query() const;
|
||||
%End
|
||||
virtual void clear();
|
||||
QSqlError lastError() const;
|
||||
virtual void fetchMore(const QModelIndex &parent = QModelIndex());
|
||||
virtual bool canFetchMore(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
protected:
|
||||
virtual void queryChange();
|
||||
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
|
||||
void setLastError(const QSqlError &error);
|
||||
void beginResetModel();
|
||||
void endResetModel();
|
||||
void beginInsertRows(const QModelIndex &parent, int first, int last);
|
||||
void endInsertRows();
|
||||
void beginRemoveRows(const QModelIndex &parent, int first, int last);
|
||||
void endRemoveRows();
|
||||
void beginInsertColumns(const QModelIndex &parent, int first, int last);
|
||||
void endInsertColumns();
|
||||
void beginRemoveColumns(const QModelIndex &parent, int first, int last);
|
||||
void endRemoveColumns();
|
||||
|
||||
public:
|
||||
virtual QHash<int, QByteArray> roleNames() const;
|
||||
%If (Qt_6_9_0 -)
|
||||
void refresh();
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
// qsqlrecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlrecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSqlRecord();
|
||||
QSqlRecord(const QSqlRecord &other);
|
||||
~QSqlRecord();
|
||||
bool operator==(const QSqlRecord &other) const;
|
||||
bool operator!=(const QSqlRecord &other) const;
|
||||
QVariant value(int i) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
QVariant value(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
QVariant value(const QString &name) const;
|
||||
%End
|
||||
void setValue(int i, const QVariant &val);
|
||||
%If (Qt_6_8_0 -)
|
||||
void setValue(QAnyStringView name, const QVariant &val);
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
void setValue(const QString &name, const QVariant &val);
|
||||
%End
|
||||
void setNull(int i);
|
||||
%If (Qt_6_8_0 -)
|
||||
void setNull(QAnyStringView name);
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
void setNull(const QString &name);
|
||||
%End
|
||||
bool isNull(int i) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool isNull(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
bool isNull(const QString &name) const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
int indexOf(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
int indexOf(const QString &name) const;
|
||||
%End
|
||||
QString fieldName(int i) const;
|
||||
QSqlField field(int i) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
QSqlField field(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
QSqlField field(const QString &name) const;
|
||||
%End
|
||||
bool isGenerated(int i) const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool isGenerated(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
bool isGenerated(const QString &name) const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setGenerated(QAnyStringView name, bool generated);
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
void setGenerated(const QString &name, bool generated);
|
||||
%End
|
||||
void setGenerated(int i, bool generated);
|
||||
void append(const QSqlField &field);
|
||||
void replace(int pos, const QSqlField &field);
|
||||
void insert(int pos, const QSqlField &field);
|
||||
void remove(int pos);
|
||||
bool isEmpty() const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool contains(QAnyStringView name) const;
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
bool contains(const QString &name) const;
|
||||
%End
|
||||
void clear();
|
||||
void clearValues();
|
||||
int count() const /__len__/;
|
||||
QSqlRecord keyValues(const QSqlRecord &keyFields) const;
|
||||
%If (Qt_6_6_0 -)
|
||||
void swap(QSqlRecord &other /Constrained/);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
// qsqlrelationaldelegate.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlRelationalDelegate : public QStyledItemDelegate
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlrelationaldelegate.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QSqlRelationalDelegate(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QSqlRelationalDelegate();
|
||||
virtual QWidget *createEditor(QWidget *parent /TransferThis/, const QStyleOptionViewItem &option /NoCopy/, const QModelIndex &index) const;
|
||||
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
|
||||
virtual void setModelData(QWidget *editor, QAbstractItemModel *model /KeepReference/, const QModelIndex &index) const;
|
||||
};
|
||||
@@ -0,0 +1,73 @@
|
||||
// qsqlrelationaltablemodel.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlRelation
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlrelationaltablemodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSqlRelation();
|
||||
QSqlRelation(const QString &aTableName, const QString &indexCol, const QString &displayCol);
|
||||
QString tableName() const;
|
||||
QString indexColumn() const;
|
||||
QString displayColumn() const;
|
||||
bool isValid() const;
|
||||
void swap(QSqlRelation &other /Constrained/);
|
||||
};
|
||||
|
||||
class QSqlRelationalTableModel : public QSqlTableModel
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlrelationaltablemodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSqlRelationalTableModel(QObject *parent /TransferThis/ = 0, const QSqlDatabase &db = QSqlDatabase());
|
||||
virtual ~QSqlRelationalTableModel();
|
||||
virtual QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const;
|
||||
virtual bool setData(const QModelIndex &item, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual void clear();
|
||||
virtual bool select();
|
||||
virtual void setTable(const QString &tableName);
|
||||
virtual void setRelation(int column, const QSqlRelation &relation);
|
||||
QSqlRelation relation(int column) const;
|
||||
virtual QSqlTableModel *relationModel(int column) const;
|
||||
virtual void revertRow(int row);
|
||||
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
|
||||
protected:
|
||||
virtual QString selectStatement() const;
|
||||
virtual bool updateRowInTable(int row, const QSqlRecord &values);
|
||||
virtual QString orderByClause() const;
|
||||
virtual bool insertRowIntoTable(const QSqlRecord &values);
|
||||
|
||||
public:
|
||||
enum JoinMode
|
||||
{
|
||||
InnerJoin,
|
||||
LeftJoin,
|
||||
};
|
||||
|
||||
void setJoinMode(QSqlRelationalTableModel::JoinMode joinMode);
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
// qsqlresult.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlResult /Supertype=PyQt6.sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqlresult.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QSqlResult();
|
||||
virtual QVariant handle() const;
|
||||
|
||||
protected:
|
||||
enum BindingSyntax
|
||||
{
|
||||
PositionalBinding,
|
||||
NamedBinding,
|
||||
};
|
||||
|
||||
explicit QSqlResult(const QSqlDriver *db);
|
||||
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 at);
|
||||
virtual void setActive(bool a);
|
||||
virtual void setLastError(const QSqlError &e);
|
||||
virtual void setQuery(const QString &query);
|
||||
virtual void setSelect(bool s);
|
||||
virtual void setForwardOnly(bool forward);
|
||||
virtual bool exec() /ReleaseGIL/;
|
||||
virtual bool prepare(const QString &query) /ReleaseGIL/;
|
||||
virtual bool savePrepare(const QString &sqlquery);
|
||||
virtual void bindValue(int pos, const QVariant &val, QSql::ParamType type);
|
||||
virtual void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type);
|
||||
void addBindValue(const QVariant &val, QSql::ParamType type);
|
||||
QVariant boundValue(const QString &placeholder) const;
|
||||
QVariant boundValue(int pos) const;
|
||||
QSql::ParamType bindValueType(const QString &placeholder) const;
|
||||
QSql::ParamType bindValueType(int pos) const;
|
||||
int boundValueCount() const;
|
||||
%If (Qt_6_6_0 -)
|
||||
QVariantList boundValues() const [QVariantList (Qt::Disambiguated_t = Qt::Disambiguated)];
|
||||
%MethodCode
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipRes = new ::QVariantList(sipCpp->boundValues());
|
||||
#else
|
||||
sipRes = new ::QVariantList(sipCpp->sipProtect_boundValues(Qt::Disambiguated));
|
||||
#endif
|
||||
%End
|
||||
|
||||
%End
|
||||
%If (- Qt_6_6_0)
|
||||
QList<QVariant> &boundValues() const;
|
||||
%End
|
||||
QString executedQuery() const;
|
||||
QString boundValueName(int pos) const;
|
||||
void clear();
|
||||
bool hasOutValues() const;
|
||||
QSqlResult::BindingSyntax bindingSyntax() const;
|
||||
virtual QVariant data(int i) = 0;
|
||||
virtual bool isNull(int i) = 0;
|
||||
virtual bool reset(const QString &sqlquery) = 0;
|
||||
virtual bool fetch(int i) = 0 /ReleaseGIL/;
|
||||
virtual bool fetchNext() /ReleaseGIL/;
|
||||
virtual bool fetchPrevious() /ReleaseGIL/;
|
||||
virtual bool fetchFirst() = 0 /ReleaseGIL/;
|
||||
virtual bool fetchLast() = 0 /ReleaseGIL/;
|
||||
virtual int size() = 0;
|
||||
virtual int numRowsAffected() = 0;
|
||||
virtual QSqlRecord record() const;
|
||||
virtual QVariant lastInsertId() const;
|
||||
%If (Qt_6_6_0 -)
|
||||
QStringList boundValueNames() const;
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
void setPositionalBindingEnabled(bool enable);
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
bool isPositionalBindingEnabled() const;
|
||||
%End
|
||||
|
||||
private:
|
||||
QSqlResult(const QSqlResult &);
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
// qsqltablemodel.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QSqlTableModel : public QSqlQueryModel
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsqltablemodel.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum EditStrategy
|
||||
{
|
||||
OnFieldChange,
|
||||
OnRowChange,
|
||||
OnManualSubmit,
|
||||
};
|
||||
|
||||
QSqlTableModel(QObject *parent /TransferThis/ = 0, const QSqlDatabase &db = QSqlDatabase());
|
||||
virtual ~QSqlTableModel();
|
||||
virtual bool select();
|
||||
virtual void setTable(const QString &tableName);
|
||||
QString tableName() const;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
virtual QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;
|
||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
bool isDirty(const QModelIndex &index) const;
|
||||
bool isDirty() const;
|
||||
virtual void clear();
|
||||
virtual void setEditStrategy(QSqlTableModel::EditStrategy strategy);
|
||||
QSqlTableModel::EditStrategy editStrategy() const;
|
||||
QSqlIndex primaryKey() const;
|
||||
QSqlDatabase database() const;
|
||||
int fieldIndex(const QString &fieldName) const;
|
||||
virtual void sort(int column, Qt::SortOrder order);
|
||||
virtual void setSort(int column, Qt::SortOrder order);
|
||||
QString filter() const;
|
||||
virtual void setFilter(const QString &filter);
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||
bool insertRecord(int row, const QSqlRecord &record);
|
||||
bool setRecord(int row, const QSqlRecord &record);
|
||||
virtual void revertRow(int row);
|
||||
|
||||
public slots:
|
||||
virtual bool submit();
|
||||
virtual void revert();
|
||||
bool submitAll();
|
||||
void revertAll();
|
||||
|
||||
signals:
|
||||
void primeInsert(int row, QSqlRecord &record);
|
||||
void beforeInsert(QSqlRecord &record);
|
||||
void beforeUpdate(int row, QSqlRecord &record);
|
||||
void beforeDelete(int row);
|
||||
|
||||
protected:
|
||||
virtual bool updateRowInTable(int row, const QSqlRecord &values);
|
||||
virtual bool insertRowIntoTable(const QSqlRecord &values);
|
||||
virtual bool deleteRowFromTable(int row);
|
||||
virtual QString orderByClause() const;
|
||||
virtual QString selectStatement() const;
|
||||
void setPrimaryKey(const QSqlIndex &key);
|
||||
%If (- Qt_6_5_0)
|
||||
void setQuery(const QSqlQuery &query);
|
||||
%End
|
||||
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
|
||||
QSqlRecord primaryValues(int row) const;
|
||||
|
||||
public:
|
||||
virtual bool selectRow(int row);
|
||||
QSqlRecord record() const;
|
||||
QSqlRecord record(int row) const;
|
||||
virtual bool clearItemData(const QModelIndex &index);
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
// qtsqlglobal.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtSql Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
namespace QSql
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtsqlglobal.h>
|
||||
%End
|
||||
|
||||
enum Location
|
||||
{
|
||||
BeforeFirstRow,
|
||||
AfterLastRow,
|
||||
};
|
||||
|
||||
enum ParamTypeFlag /BaseType=Flag/
|
||||
{
|
||||
In,
|
||||
Out,
|
||||
InOut,
|
||||
Binary,
|
||||
};
|
||||
|
||||
typedef QFlags<QSql::ParamTypeFlag> ParamType;
|
||||
|
||||
enum TableType
|
||||
{
|
||||
Tables,
|
||||
SystemTables,
|
||||
Views,
|
||||
AllTables,
|
||||
};
|
||||
|
||||
enum NumericalPrecisionPolicy
|
||||
{
|
||||
LowPrecisionInt32,
|
||||
LowPrecisionInt64,
|
||||
LowPrecisionDouble,
|
||||
HighPrecision,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user