aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml')
-rw-r--r--sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml92
1 files changed, 12 insertions, 80 deletions
diff --git a/sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml b/sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml
index a8bf52112..9cfa176c8 100644
--- a/sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml
+++ b/sources/pyside6/PySide6/QtUiTools/typesystem_uitools.xml
@@ -1,46 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// 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.QtUiTools">
+<typesystem package="PySide6.QtUiTools"
+ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<object-type name="QUiLoader">
@@ -49,42 +14,11 @@
</extra-includes>
<inject-code class="native" position="beginning" file="../glue/qtuitools.cpp" snippet="uitools-loadui"/>
<inject-code file="../glue/qtuitools.cpp" snippet="quiloader"/>
- <add-function signature="registerCustomWidget(PyObject*)" return-type="void">
- <modify-argument index="1">
- <rename to="customWidgetType"/>
- </modify-argument>
- <inject-documentation format="target" mode="append">
- Registers a Python created custom widget to QUiLoader, so it can be recognized when
- loading a `.ui` file. The custom widget type is passed via the ``customWidgetType`` argument.
- This is needed when you want to override a virtual method of some widget in the interface,
- since duck punching will not work with widgets created by QUiLoader based on the contents
- of the `.ui` file.
-
- (Remember that `duck punching virtual methods is an invitation for your own demise!
- &lt;https://doc.qt.io/qtforpython/shiboken6/wordsofadvice.html#duck-punching-and-virtual-methods>`_)
-
- Let's see an obvious example. If you want to create a new widget it's probable you'll end up
- overriding :class:`~PySide6.QtGui.QWidget`'s :meth:`~PySide6.QtGui.QWidget.paintEvent` method.
-
- .. code-block:: python
-
- class Circle(QWidget):
- def paintEvent(self, event):
- painter = QPainter(self)
- painter.setPen(self.pen)
- painter.setBrush(QBrush(self.color))
- painter.drawEllipse(event.rect().center(), 20, 20)
-
- # ...
-
- loader = QUiLoader()
- loader.registerCustomWidget(Circle)
- circle = loader.load('circle.ui')
- circle.show()
-
- # ...
- </inject-documentation>
- <inject-code class="target" position="beginning" file="../glue/qtuitools.cpp" snippet="quiloader-registercustomwidget"/>
+ <add-function signature="registerCustomWidget(PyObject*@customWidgetType@)" return-type="void">
+ <inject-documentation format="target" mode="append" file="../doc/qtuitools.rst"
+ snippet="quiloader-registercustomwidget"/>
+ <inject-code class="target" position="beginning" file="../glue/qtuitools.cpp"
+ snippet="quiloader-registercustomwidget"/>
</add-function>
<modify-function signature="createAction(QObject*,const QString&amp;)">
<modify-argument index="return">
@@ -130,11 +64,7 @@
</modify-function>
<!-- Syntax sugar -->
- <add-function signature="load(PyPathLike,QWidget*)" return-type="QWidget*">
- <modify-argument index="2">
- <replace-default-expression with="0"/>
- <rename to="parentWidget"/>
- </modify-argument>
+ <add-function signature="load(PyPathLike,QWidget*@parentWidget@=nullptr)" return-type="QWidget*">
<modify-argument index="return">
<define-ownership class="target" owner="target"/>
</modify-argument>
@@ -150,6 +80,8 @@
-->
<add-function signature="loadUiType(const QString&amp; @uifile@)" return-type="PyObject*">
<inject-code file="../glue/qtuitools.cpp" snippet="loaduitype"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtuitools.rst"
+ snippet="loaduitype"/>
</add-function>