aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/plugins/uitools/customwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/plugins/uitools/customwidget.h')
-rw-r--r--sources/pyside6/plugins/uitools/customwidget.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/sources/pyside6/plugins/uitools/customwidget.h b/sources/pyside6/plugins/uitools/customwidget.h
new file mode 100644
index 000000000..52621f0bd
--- /dev/null
+++ b/sources/pyside6/plugins/uitools/customwidget.h
@@ -0,0 +1,37 @@
+// 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_
+
+#include <shiboken.h>
+
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+
+class PyCustomWidget: public QObject, public QDesignerCustomWidgetInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+
+public:
+ explicit PyCustomWidget(PyObject *objectType);
+
+ bool isContainer() const override;
+ bool isInitialized() const override;
+ QIcon icon() const override;
+ QString domXml() const override;
+ QString group() const override;
+ QString includeFile() const override;
+ QString name() const override;
+ QString toolTip() const override;
+ QString whatsThis() const override;
+ QWidget *createWidget(QWidget *parent) override;
+ void initialize(QDesignerFormEditorInterface *core) override;
+
+private:
+ PyObject *m_pyObject = nullptr;
+ const QString m_name;
+ bool m_initialized = false;
+};
+
+#endif // PY_CUSTOM_WIDGET_H_