From 25180730194bec25f915f32ab846ea583fb1493f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 2 Nov 2020 16:11:52 +0100 Subject: Rename PySide2 to PySide6 Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer --- sources/pyside2/PySide2/QtUiTools/CMakeLists.txt | 42 ------ sources/pyside2/PySide2/QtUiTools/glue/plugins.h | 67 --------- .../PySide2/QtUiTools/typesystem_uitools.xml | 157 --------------------- 3 files changed, 266 deletions(-) delete mode 100644 sources/pyside2/PySide2/QtUiTools/CMakeLists.txt delete mode 100644 sources/pyside2/PySide2/QtUiTools/glue/plugins.h delete mode 100644 sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml (limited to 'sources/pyside2/PySide2/QtUiTools') diff --git a/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt b/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt deleted file mode 100644 index f9ca16e5a..000000000 --- a/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -project(QtUiTools) - -set(QtUiTools_SRC -${QtUiTools_GEN_DIR}/quiloader_wrapper.cpp -# module is always needed -${QtUiTools_GEN_DIR}/qtuitools_module_wrapper.cpp -) - -set(QtUiTools_glue_sources - "${QtUiTools_SOURCE_DIR}/glue/plugins.h" -) - -set(QtUiTools_include_dirs ${QtUiTools_SOURCE_DIR} - ${QtUiTools_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}Xml_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}Designer_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}UiTools_INCLUDE_DIRS} - ${libpyside_SOURCE_DIR} - ${plugins_SOURCE_DIR} - ${QtCore_GEN_DIR} - ${QtXml_GEN_DIR} - ${QtGui_GEN_DIR} - ${QtWidgets_GEN_DIR} - ) -set(QtUiTools_libraries pyside2 - uiplugin - ${Qt${QT_MAJOR_VERSION}UiTools_LIBRARIES} - ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES} - ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES} - ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES} - ) -set(QtUiTools_deps QtWidgets QtXml) -create_pyside_module(NAME QtUiTools - INCLUDE_DIRS QtUiTools_include_dirs - LIBRARIES QtUiTools_libraries - DEPS QtUiTools_deps - TYPESYSTEM_PATH QtUiTools_SOURCE_DIR - SOURCES QtUiTools_SRC - GLUE_SOURCES QtUiTools_glue_sources) diff --git a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h b/sources/pyside2/PySide2/QtUiTools/glue/plugins.h deleted file mode 100644 index 402965a81..000000000 --- a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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$ -** -****************************************************************************/ - -#ifndef _PLUGIN_H_ -#define _PLUGIN_H_ - -#include "customwidgets.h" - -#include - -static inline PyCustomWidgets *findPlugin() -{ - const auto &instances = QPluginLoader::staticInstances(); - for (QObject *o : instances) { - if (auto plugin = qobject_cast(o)) - return plugin; - } - return nullptr; -} - -static void registerCustomWidget(PyObject *obj) -{ - static PyCustomWidgets *const plugin = findPlugin(); - - if (plugin) - plugin->registerWidgetType(obj); - else - qWarning("Qt for Python: Failed to find the static QUiLoader plugin."); -} - -#endif diff --git a/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml b/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml deleted file mode 100644 index 43ed7a60e..000000000 --- a/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - 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! - <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:`~PySide2.QtGui.QWidget`'s :meth:`~PySide2.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() - - # ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3