diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-23 07:37:33 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-23 07:37:33 +0200 |
| commit | 6fcccf20dab907aa037cd9737b6349b2cad3323f (patch) | |
| tree | 7398fcfb28840ee4a2e55110ca30eea0456ade5d /sources/pyside2/plugins/customwidgets.cpp | |
| parent | b10e77f3e518979c9bae492d2f7a2f03eff06af2 (diff) | |
| parent | cacfabc03198b1bcd314d4ebdb0b7e06dfe097ff (diff) | |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I478e94aa42c9f79011edf97f19a7abebb7214421
Diffstat (limited to 'sources/pyside2/plugins/customwidgets.cpp')
| -rw-r--r-- | sources/pyside2/plugins/customwidgets.cpp | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/sources/pyside2/plugins/customwidgets.cpp b/sources/pyside2/plugins/customwidgets.cpp index e78dde206..28a2a6cf6 100644 --- a/sources/pyside2/plugins/customwidgets.cpp +++ b/sources/pyside2/plugins/customwidgets.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. @@ -37,47 +37,25 @@ ** ****************************************************************************/ -#include "customwidget.h" #include "customwidgets.h" - - -struct PyCustomWidgetPrivate -{ - PyObject *pyObject; - bool initialized; -}; - -struct PyCustomWidgetsPrivate -{ - QList<QDesignerCustomWidgetInterface *> widgets; - ~PyCustomWidgetsPrivate(); -}; - - -PyCustomWidgetsPrivate::~PyCustomWidgetsPrivate() -{ - qDeleteAll(widgets); - widgets.clear(); -} +#include "customwidget.h" PyCustomWidgets::PyCustomWidgets(QObject *parent) - : QObject(parent), m_data(new PyCustomWidgetsPrivate) + : QObject(parent) { } PyCustomWidgets::~PyCustomWidgets() { - delete m_data; + qDeleteAll(m_widgets); } void PyCustomWidgets::registerWidgetType(PyObject *widget) { - m_data->widgets.append(new PyCustomWidget(widget)); + m_widgets.append(new PyCustomWidget(widget)); } QList<QDesignerCustomWidgetInterface *> PyCustomWidgets::customWidgets() const { - return m_data->widgets; + return m_widgets; } - - |
