aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/plugins')
-rw-r--r--sources/pyside6/plugins/designer/CMakeLists.txt15
-rw-r--r--sources/pyside6/plugins/designer/designercustomwidgets.cpp84
-rw-r--r--sources/pyside6/plugins/designer/designercustomwidgets.h50
-rw-r--r--sources/pyside6/plugins/uitools/CMakeLists.txt18
-rw-r--r--sources/pyside6/plugins/uitools/customwidget.cpp64
-rw-r--r--sources/pyside6/plugins/uitools/customwidget.h48
-rw-r--r--sources/pyside6/plugins/uitools/customwidgets.cpp40
-rw-r--r--sources/pyside6/plugins/uitools/customwidgets.h48
8 files changed, 82 insertions, 285 deletions
diff --git a/sources/pyside6/plugins/designer/CMakeLists.txt b/sources/pyside6/plugins/designer/CMakeLists.txt
index 50074be51..717652314 100644
--- a/sources/pyside6/plugins/designer/CMakeLists.txt
+++ b/sources/pyside6/plugins/designer/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
project(PySidePlugin)
# Note: At runtime, the dependency to the shiboken library is resolved
@@ -7,18 +10,18 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS UiPlugin)
+find_package(Qt6 COMPONENTS Core Gui Widgets UiPlugin)
qt_add_plugin(PySidePlugin)
target_sources(PySidePlugin PRIVATE
- designercustomwidgets.cpp
+ designercustomwidgets.cpp designercustomwidgets.h
)
# See libshiboken/CMakeLists.txt
+
+target_compile_definitions(PySidePlugin PRIVATE -DQT_NO_KEYWORDS=1)
+
if(PYTHON_LIMITED_API)
target_compile_definitions(PySidePlugin PRIVATE "-DPy_LIMITED_API=0x03050000")
endif()
@@ -53,4 +56,4 @@ target_link_libraries(PySidePlugin PRIVATE
Qt::Widgets
${SHIBOKEN_PYTHON_LIBRARIES})
-install(TARGETS PySidePlugin LIBRARY DESTINATION "plugins/designer")
+install(TARGETS PySidePlugin LIBRARY DESTINATION "${QT6_INSTALL_PLUGINS}/designer")
diff --git a/sources/pyside6/plugins/designer/designercustomwidgets.cpp b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
index dd758bb98..d23156a9d 100644
--- a/sources/pyside6/plugins/designer/designercustomwidgets.cpp
+++ b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 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) 2021 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
+#undef slots
#include <Python.h> // Include before Qt headers due to 'slots' macro definition
#include "designercustomwidgets.h"
@@ -53,6 +18,8 @@
#include <string_view>
+using namespace Qt::StringLiterals;
+
Q_LOGGING_CATEGORY(lcPySidePlugin, "qt.pysideplugin")
static const char pathVar[] = "PYSIDE_DESIGNER_PLUGINS";
@@ -63,7 +30,7 @@ static const char pythonPathVar[] = "PYTHONPATH";
static QDesignerCustomWidgetCollectionInterface *findPyDesignerCustomWidgetCollection()
{
static const char propertyName[] = "__qt_PySideCustomWidgetCollection";
- if (auto coreApp = QCoreApplication::instance()) {
+ if (auto *coreApp = QCoreApplication::instance()) {
const QVariant value = coreApp->property(propertyName);
if (value.isValid() && value.canConvert<void *>())
return reinterpret_cast<QDesignerCustomWidgetCollectionInterface *>(value.value<void *>());
@@ -83,17 +50,17 @@ static QString pyStringToQString(PyObject *s)
static QString pyStr(PyObject *o)
{
PyObject *pstr = PyObject_Str(o);
- return pstr ? pyStringToQString(pstr) : QString();
+ return pstr != nullptr ? pyStringToQString(pstr) : QString();
}
static QString pyErrorMessage()
{
- QString result = QLatin1String("<error information not available>");
+ QString result = "<error information not available>"_L1;
PyObject *ptype = {};
PyObject *pvalue = {};
PyObject *ptraceback = {};
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
- if (pvalue)
+ if (pvalue != nullptr)
result = pyStr(pvalue);
PyErr_Restore(ptype, pvalue, ptraceback);
return result;
@@ -120,7 +87,7 @@ static bool runPyScript(const char *script, QString *errorMessage)
{
PyObject *main = PyImport_AddModule("__main__");
if (main == nullptr) {
- *errorMessage = QLatin1String("Internal error: Cannot retrieve __main__");
+ *errorMessage = "Internal error: Cannot retrieve __main__"_L1;
return false;
}
PyObject *globalDictionary = PyModule_GetDict(main);
@@ -151,8 +118,7 @@ static bool runPyScriptFile(const QString &fileName, QString *errorMessage)
file.close();
const bool ok = runPyScript(script.constData(), errorMessage);
if (!ok && !errorMessage->isEmpty()) {
- errorMessage->prepend(QLatin1String("Error running ") + fileName
- + QLatin1String(": "));
+ errorMessage->prepend("Error running "_L1 + fileName + ": "_L1);
}
return ok;
}
@@ -190,10 +156,10 @@ static void initVirtualEnvironment()
pythonPath.append(virtualEnvPath + R"(\Lib\site-packages)");
break;
case QOperatingSystemVersion::MacOS:
- pythonPath.append(virtualEnvPath + QByteArrayLiteral("/lib/python") +
+ pythonPath.append(virtualEnvPath + "/lib/python"_ba +
QByteArray::number(majorVersion) + '.'
+ QByteArray::number(minorVersion)
- + QByteArrayLiteral("/site-packages"));
+ + "/site-packages"_ba);
break;
default:
break;
@@ -211,13 +177,20 @@ static void initPython()
qAddPostRoutine(Py_Finalize);
}
+static bool withinQtDesigner = false;
+
PyDesignerCustomWidgets::PyDesignerCustomWidgets(QObject *parent) : QObject(parent)
{
qCDebug(lcPySidePlugin, "%s", __FUNCTION__);
+ withinQtDesigner = QCoreApplication::applicationName() == u"Designer"
+ && QCoreApplication::organizationName() == u"QtProject";
+
if (!qEnvironmentVariableIsSet(pathVar)) {
- qCWarning(lcPySidePlugin, "Environment variable %s is not set, bailing out.",
- pathVar);
+ if (withinQtDesigner) {
+ qCWarning(lcPySidePlugin, "Environment variable %s is not set, bailing out.",
+ pathVar);
+ }
return;
}
@@ -233,7 +206,7 @@ PyDesignerCustomWidgets::PyDesignerCustomWidgets(QObject *parent) : QObject(pare
QDir dir(p);
if (dir.exists()) {
const QFileInfoList matches =
- dir.entryInfoList({QStringLiteral("register*.py")}, QDir::Files,
+ dir.entryInfoList({u"register*.py"_s}, QDir::Files,
QDir::Name);
for (const auto &fi : matches)
pythonFiles.append(fi.absoluteFilePath());
@@ -260,11 +233,13 @@ PyDesignerCustomWidgets::PyDesignerCustomWidgets(QObject *parent) : QObject(pare
qputenv(pythonPathVar, value);
}
- initPython();
+ // Might be initialized already, for example, when loaded from QUiLoader.
+ if (Py_IsInitialized() == 0)
+ initPython();
// Run all register*py files
QString errorMessage;
- for (const auto &pythonFile : qAsConst(pythonFiles)) {
+ for (const auto &pythonFile : std::as_const(pythonFiles)) {
qCDebug(lcPySidePlugin) << "running" << pythonFile;
if (!runPyScriptFile(pythonFile, &errorMessage))
qCWarning(lcPySidePlugin, "%s", qPrintable(errorMessage));
@@ -278,8 +253,9 @@ PyDesignerCustomWidgets::~PyDesignerCustomWidgets()
QList<QDesignerCustomWidgetInterface *> PyDesignerCustomWidgets::customWidgets() const
{
- if (auto collection = findPyDesignerCustomWidgetCollection())
+ if (auto *collection = findPyDesignerCustomWidgetCollection())
return collection->customWidgets();
- qCWarning(lcPySidePlugin, "No instance of QPyDesignerCustomWidgetCollection was found.");
+ if (withinQtDesigner)
+ qCWarning(lcPySidePlugin, "No instance of QPyDesignerCustomWidgetCollection was found.");
return {};
}
diff --git a/sources/pyside6/plugins/designer/designercustomwidgets.h b/sources/pyside6/plugins/designer/designercustomwidgets.h
index d37f41173..2f1db1f31 100644
--- a/sources/pyside6/plugins/designer/designercustomwidgets.h
+++ b/sources/pyside6/plugins/designer/designercustomwidgets.h
@@ -1,44 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 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) 2021 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
-#ifndef _PY_DESIGNER_CUSTOM_WIDGETS_H_
-#define _PY_DESIGNER_CUSTOM_WIDGETS_H_
+#ifndef PY_DESIGNER_CUSTOM_WIDGETS_H_
+#define PY_DESIGNER_CUSTOM_WIDGETS_H_
#include <QtUiPlugin/QDesignerCustomWidgetCollectionInterface>
@@ -53,10 +17,12 @@ class PyDesignerCustomWidgets: public QObject,
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.PySide.PyDesignerCustomWidgetsInterface")
public:
+ Q_DISABLE_COPY_MOVE(PyDesignerCustomWidgets)
+
explicit PyDesignerCustomWidgets(QObject *parent = nullptr);
- ~PyDesignerCustomWidgets();
+ ~PyDesignerCustomWidgets() override;
QList<QDesignerCustomWidgetInterface *> customWidgets() const override;
};
-#endif // _PY_DESIGNER_CUSTOM_WIDGETS_H_
+#endif // PY_DESIGNER_CUSTOM_WIDGETS_H_
diff --git a/sources/pyside6/plugins/uitools/CMakeLists.txt b/sources/pyside6/plugins/uitools/CMakeLists.txt
index b24d5f9d7..06d0ae900 100644
--- a/sources/pyside6/plugins/uitools/CMakeLists.txt
+++ b/sources/pyside6/plugins/uitools/CMakeLists.txt
@@ -1,17 +1,17 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
project(plugins)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS UiPlugin)
+find_package(Qt6 COMPONENTS Core Gui Widgets UiPlugin)
set(ui_plugin_src
- customwidgets.cpp
- customwidget.cpp
+ customwidgets.cpp customwidgets.h
+ customwidget.cpp customwidget.h
)
add_library(uiplugin STATIC ${ui_plugin_src})
@@ -20,11 +20,7 @@ if(CMAKE_HOST_UNIX AND NOT CYGWIN)
endif()
add_definitions(-DQT_STATICPLUGIN)
-if(${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- set_property(TARGET pyside6 PROPERTY CXX_STANDARD 17)
-else()
- set_property(TARGET pyside6 PROPERTY CXX_STANDARD 11)
-endif()
+set_property(TARGET pyside6 PROPERTY CXX_STANDARD 17)
target_link_libraries(uiplugin
Qt::Core
diff --git a/sources/pyside6/plugins/uitools/customwidget.cpp b/sources/pyside6/plugins/uitools/customwidget.cpp
index 8b7a61238..976754feb 100644
--- a/sources/pyside6/plugins/uitools/customwidget.cpp
+++ b/sources/pyside6/plugins/uitools/customwidget.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 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
#include "customwidget.h"
#include <QtCore/qdebug.h>
@@ -60,22 +24,22 @@ bool PyCustomWidget::isInitialized() const
QIcon PyCustomWidget::icon() const
{
- return QIcon();
+ return {};
}
QString PyCustomWidget::domXml() const
{
- return QString();
+ return {};
}
QString PyCustomWidget::group() const
{
- return QString();
+ return {};
}
QString PyCustomWidget::includeFile() const
{
- return QString();
+ return {};
}
QString PyCustomWidget::name() const
@@ -85,12 +49,12 @@ QString PyCustomWidget::name() const
QString PyCustomWidget::toolTip() const
{
- return QString();
+ return {};
}
QString PyCustomWidget::whatsThis() const
{
- return QString();
+ return {};
}
// A copy of this code exists in PyDesignerCustomWidget::createWidget()
@@ -100,9 +64,9 @@ QWidget *PyCustomWidget::createWidget(QWidget *parent)
// Create a python instance and return cpp object
PyObject *pyParent = nullptr;
bool unknownParent = false;
- if (parent) {
+ if (parent != nullptr) {
pyParent = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(parent));
- if (pyParent) {
+ if (pyParent != nullptr) {
Py_INCREF(pyParent);
} else {
static Shiboken::Conversions::SpecificConverter converter("QWidget*");
@@ -115,11 +79,11 @@ QWidget *PyCustomWidget::createWidget(QWidget *parent)
}
Shiboken::AutoDecRef pyArgs(PyTuple_New(1));
- PyTuple_SET_ITEM(pyArgs, 0, pyParent); // tuple will keep pyParent reference
+ PyTuple_SET_ITEM(pyArgs.object(), 0, pyParent); // tuple will keep pyParent reference
// Call python constructor
- auto result = reinterpret_cast<SbkObject *>(PyObject_CallObject(m_pyObject, pyArgs));
- if (!result) {
+ auto *result = reinterpret_cast<SbkObject *>(PyObject_CallObject(m_pyObject, pyArgs));
+ if (result == nullptr) {
qWarning("Unable to create a Python custom widget of type \"%s\".",
qPrintable(m_name));
PyErr_Print();
@@ -134,7 +98,7 @@ QWidget *PyCustomWidget::createWidget(QWidget *parent)
return reinterpret_cast<QWidget *>(Shiboken::Object::cppPointer(result, Py_TYPE(result)));
}
-void PyCustomWidget::initialize(QDesignerFormEditorInterface *core)
+void PyCustomWidget::initialize(QDesignerFormEditorInterface *)
{
m_initialized = true;
}
diff --git a/sources/pyside6/plugins/uitools/customwidget.h b/sources/pyside6/plugins/uitools/customwidget.h
index b84a967bf..52621f0bd 100644
--- a/sources/pyside6/plugins/uitools/customwidget.h
+++ b/sources/pyside6/plugins/uitools/customwidget.h
@@ -1,51 +1,13 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 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
-#ifndef _PY_CUSTOM_WIDGET_H_
-#define _PY_CUSTOM_WIDGET_H_
+#ifndef PY_CUSTOM_WIDGET_H_
+#define PY_CUSTOM_WIDGET_H_
#include <shiboken.h>
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
-#include <QtCore/qglobal.h>
-
class PyCustomWidget: public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
@@ -72,4 +34,4 @@ private:
bool m_initialized = false;
};
-#endif // _PY_CUSTOM_WIDGET_H_
+#endif // PY_CUSTOM_WIDGET_H_
diff --git a/sources/pyside6/plugins/uitools/customwidgets.cpp b/sources/pyside6/plugins/uitools/customwidgets.cpp
index 28a2a6cf6..93b6b4a10 100644
--- a/sources/pyside6/plugins/uitools/customwidgets.cpp
+++ b/sources/pyside6/plugins/uitools/customwidgets.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 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
#include "customwidgets.h"
#include "customwidget.h"
diff --git a/sources/pyside6/plugins/uitools/customwidgets.h b/sources/pyside6/plugins/uitools/customwidgets.h
index aec817cdf..f67a0847d 100644
--- a/sources/pyside6/plugins/uitools/customwidgets.h
+++ b/sources/pyside6/plugins/uitools/customwidgets.h
@@ -1,44 +1,8 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 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
-#ifndef _PY_CUSTOM_WIDGETS_H_
-#define _PY_CUSTOM_WIDGETS_H_
+#ifndef PY_CUSTOM_WIDGETS_H_
+#define PY_CUSTOM_WIDGETS_H_
#include <shiboken.h>
@@ -54,8 +18,10 @@ class PyCustomWidgets: public QObject, public QDesignerCustomWidgetCollectionInt
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.PySide.PyCustomWidgetsInterface")
public:
+ Q_DISABLE_COPY_MOVE(PyCustomWidgets)
+
explicit PyCustomWidgets(QObject *parent = nullptr);
- ~PyCustomWidgets();
+ ~PyCustomWidgets() override;
QList<QDesignerCustomWidgetInterface*> customWidgets() const override;