aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtSql
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/QtSql')
-rw-r--r--sources/pyside6/PySide6/QtSql/CMakeLists.txt52
-rw-r--r--sources/pyside6/PySide6/QtSql/QtSql_global.pre.h.in5
-rw-r--r--sources/pyside6/PySide6/QtSql/typesystem_sql.xml182
3 files changed, 239 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtSql/CMakeLists.txt b/sources/pyside6/PySide6/QtSql/CMakeLists.txt
new file mode 100644
index 000000000..fedebe642
--- /dev/null
+++ b/sources/pyside6/PySide6/QtSql/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+project(QtSql)
+
+set(QtSql_SRC
+${QtSql_GEN_DIR}/qsql_wrapper.cpp
+${QtSql_GEN_DIR}/qsqldatabase_wrapper.cpp
+${QtSql_GEN_DIR}/qsqldriver_wrapper.cpp
+${QtSql_GEN_DIR}/qsqldrivercreatorbase_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlerror_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlfield_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlindex_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlquery_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlquerymodel_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlrecord_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlrelation_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlrelationaldelegate_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlrelationaltablemodel_wrapper.cpp
+${QtSql_GEN_DIR}/qsqlresult_wrapper.cpp
+${QtSql_GEN_DIR}/qsqltablemodel_wrapper.cpp
+# module is always needed
+${QtSql_GEN_DIR}/qtsql_module_wrapper.cpp
+)
+
+configure_file("${QtSql_SOURCE_DIR}/QtSql_global.pre.h.in"
+ "${QtSql_BINARY_DIR}/QtSql_global.pre.h" @ONLY)
+
+set(QtSql_include_dirs ${QtSql_SOURCE_DIR}
+ ${QtSql_BINARY_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Widgets_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Sql_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtWidgets_GEN_DIR})
+
+# Link to QtWidgets to enable QSqlRelationalDelegate
+set(QtSql_libraries pyside6
+ ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Sql_LIBRARIES})
+
+set(QtSql_deps QtWidgets)
+
+create_pyside_module(NAME QtSql
+ INCLUDE_DIRS QtSql_include_dirs
+ LIBRARIES QtSql_libraries
+ DEPS QtSql_deps
+ TYPESYSTEM_PATH QtSql_SOURCE_DIR
+ SOURCES QtSql_SRC)
diff --git a/sources/pyside6/PySide6/QtSql/QtSql_global.pre.h.in b/sources/pyside6/PySide6/QtSql/QtSql_global.pre.h.in
new file mode 100644
index 000000000..c56bc78c1
--- /dev/null
+++ b/sources/pyside6/PySide6/QtSql/QtSql_global.pre.h.in
@@ -0,0 +1,5 @@
+// QT_WIDGETS_LIB must be defined for QSqlRelationalDelegate to become visible.
+
+#if @Qt6Widgets_FOUND@
+# define QT_WIDGETS_LIB
+#endif
diff --git a/sources/pyside6/PySide6/QtSql/typesystem_sql.xml b/sources/pyside6/PySide6/QtSql/typesystem_sql.xml
new file mode 100644
index 000000000..70c3e6f69
--- /dev/null
+++ b/sources/pyside6/PySide6/QtSql/typesystem_sql.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+-->
+<typesystem package="PySide6.QtSql"
+ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
+
+ <rejection class="QSqlDriverCreator"/>
+ <rejection class="QSqlDriverPlugin"/>
+
+ <namespace-type name="QSql">
+ <enum-type name="Location"/>
+ <enum-type name="ParamTypeFlag" flags="ParamType"/>
+ <enum-type name="TableType"/>
+ <enum-type name="NumericalPrecisionPolicy"/>
+ <extra-includes>
+ <include file-name="QtSql/qtsqlglobal.h" location="global"/>
+ </extra-includes>
+ </namespace-type>
+
+ <value-type name="QSqlDatabase">
+ <extra-includes>
+ <include file-name="QSqlQuery" location="global"/>
+ <include file-name="QSqlError" location="global"/>
+ <include file-name="QSqlIndex" location="global"/>
+ <include file-name="QSqlRecord" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <modify-function signature="exec(QString)const" allow-thread="yes"/>
+ <add-function signature="exec_(QString @query@ = QString())const" return-type="QSqlQuery">
+ <inject-code file="../glue/qtsql.cpp" snippet="qsqldatabase-exec"/>
+ </add-function>
+ <modify-function signature="open()" allow-thread="yes"/>
+ <modify-function signature="open(const QString&amp;, const QString&amp;)" allow-thread="yes"/>
+ <modify-function signature="commit()" allow-thread="yes"/>
+ <modify-function signature="rollback()" allow-thread="yes"/>
+ <modify-function signature="transaction()" allow-thread="yes"/>
+ <modify-function signature="registerSqlDriver(const QString&amp;,QSqlDriverCreatorBase*)">
+ <modify-argument index="2">
+ <define-ownership owner="c++"/>
+ </modify-argument>
+ </modify-function>
+ </value-type>
+
+ <value-type name="QSqlQuery">
+ <enum-type name="BatchExecutionMode"/>
+ <extra-includes>
+ <include file-name="QSqlError" location="global"/>
+ <include file-name="QSqlRecord" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <!-- exec() -->
+ <modify-function signature="exec()" allow-thread="yes"/>
+ <add-function signature="exec_()" return-type="bool">
+ <inject-code file="../glue/qtsql.cpp" snippet="simple-exec"/>
+ </add-function>
+ <!-- exec(QString) -->
+ <modify-function signature="exec(const QString&amp;)" allow-thread="yes"/>
+ <add-function signature="exec_(const QString&amp;)" return-type="bool">
+ <inject-code file="../glue/qtsql.cpp" snippet="qsqlquery-exec"/>
+ </add-function>
+ <modify-function signature="prepare(const QString&amp;)" allow-thread="yes"/>
+ <modify-function signature="clear()" allow-thread="yes"/>
+ <modify-function signature="last()" allow-thread="yes"/>
+ <modify-function signature="first()" allow-thread="yes"/>
+ <modify-function signature="previous()" allow-thread="yes"/>
+ <modify-function signature="next()" allow-thread="yes"/>
+ <modify-function signature="seek(int,bool)" allow-thread="yes"/>
+ </value-type>
+
+ <value-type name="QSqlRecord">
+ <extra-includes>
+ <include file-name="QSqlField" location="global"/>
+ </extra-includes>
+ </value-type>
+
+ <value-type name="QSqlError">
+ <enum-type name="ErrorType"/>
+ </value-type>
+
+ <value-type name="QSqlIndex"/>
+
+ <value-type name="QSqlRelation"/>
+
+ <object-type name="QSqlRelationalDelegate"/>
+
+ <value-type name="QSqlField">
+ <enum-type name="RequiredStatus"/>
+ </value-type>
+
+ <object-type name="QSqlDriver">
+ <enum-type name="DbmsType"/>
+ <enum-type name="DriverFeature"/>
+ <enum-type name="IdentifierType"/>
+ <enum-type name="NotificationSource"/>
+ <enum-type name="StatementType"/>
+ <extra-includes>
+ <include file-name="QSqlQuery" location="global"/>
+ <include file-name="QSqlError" location="global"/>
+ <include file-name="QSqlIndex" location="global"/>
+ <include file-name="QSqlRecord" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <modify-function signature="beginTransaction()" allow-thread="yes"/>
+ <modify-function signature="commitTransaction()" allow-thread="yes"/>
+ <modify-function signature="rollbackTransaction()" allow-thread="yes"/>
+ <modify-function signature="open(const QString&amp;,const QString&amp;,const QString&amp;,const QString&amp;,int,const QString&amp;)" allow-thread="yes"/>
+ <!-- ### This is too low level for Python, and pointer would be useless for the Python programmer -->
+ <modify-function signature="handle()const" remove="all"/>
+ <!-- ### -->
+ </object-type>
+
+ <object-type name="QSqlQueryModel">
+ <extra-includes>
+ <include file-name="QSqlError" location="global"/>
+ <include file-name="QSqlQuery" location="global"/>
+ <include file-name="QSqlRecord" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <!-- FIXME: PYSIDE7: Handle setQuery(QSqlQuery&&) in some way?
+ QTBUG-91766/PYSIDE-2394. allow-thread for PYSIDE-1931 -->
+ <modify-function signature="setQuery(QSqlQuery)" allow-thread="yes"
+ deprecated="false"/>
+ <modify-function signature="setQuery(QString,QSqlDatabase)" allow-thread="yes"/>
+ <!-- FIXME: PYSIDE7: Probably needs a fix, make QSqlQuery an object type?
+ QTBUG-105048/PYSIDE-2300 -->
+ <declare-function signature="query()" return-type="QSqlQuery"/>
+ </object-type>
+ <object-type name="QSqlRelationalTableModel">
+ <enum-type name="JoinMode"/>
+ <extra-includes>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <modify-function signature="select()" allow-thread="yes"/> <!-- PYSIDE-1931 -->
+ </object-type>
+ <object-type name="QSqlResult">
+ <enum-type name="BindingSyntax"/>
+ <enum-type name="VirtualHookOperation"/>
+ <extra-includes>
+ <include file-name="QSqlError" location="global"/>
+ <include file-name="QSqlQuery" location="global"/>
+ <include file-name="QSqlRecord" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <!-- ### This isn't part of Qt public API -->
+ <modify-function signature="virtual_hook(int,void*)" remove="all"/>
+ <!-- ### -->
+ <modify-function signature="exec()" allow-thread="yes"/>
+ <add-function signature="exec_()" return-type="bool">
+ <inject-code file="../glue/qtsql.cpp" snippet="qsqlresult-exec"/>
+ </add-function>
+ <modify-function signature="fetchLast()" allow-thread="yes"/>
+ <modify-function signature="fetchFirst()" allow-thread="yes"/>
+ <modify-function signature="fetchNext()" allow-thread="yes"/>
+ <modify-function signature="fetchPrevious()" allow-thread="yes"/>
+ <modify-function signature="fetch(int)" allow-thread="yes"/>
+ <modify-function signature="prepare(QString)" allow-thread="yes"/>
+ </object-type>
+ <object-type name="QSqlTableModel">
+ <enum-type name="EditStrategy"/>
+ <extra-includes>
+ <include file-name="QSqlIndex" location="global"/>
+ <include file-name="QStringList" location="global"/>
+ <include file-name="QSize" location="global"/>
+ </extra-includes>
+ <modify-function signature="select()" allow-thread="yes"/> <!-- PYSIDE-1931 -->
+ </object-type>
+ <object-type name="QSqlDriverCreatorBase">
+ <extra-includes>
+ <include file-name="QSqlDriver" location="global"/>
+ </extra-includes>
+ </object-type>
+
+</typesystem>