Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwizard_container.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QWIZARD_CONTAINER_H
5#define QWIZARD_CONTAINER_H
6
7#include <QtDesigner/container.h>
8
9#include <qdesigner_propertysheet_p.h>
10#include <extensionfactory_p.h>
11
12#include <QtWidgets/qwizard.h>
13
15
16class QWizardPage;
17
18namespace qdesigner_internal {
19
20// Container for QWizard. Care must be taken to position
21// the QWizard at some valid page after removal/insertion
22// as it is not used to having its pages ripped out.
24{
25 Q_OBJECT
26 Q_INTERFACES(QDesignerContainerExtension)
27public:
28 explicit QWizardContainer(QWizard *widget, QObject *parent = nullptr);
29
30 int count() const override;
31 QWidget *widget(int index) const override;
32 int currentIndex() const override;
33 void setCurrentIndex(int index) override;
34 bool canAddWidget() const override { return true; }
35 void addWidget(QWidget *widget) override;
36 void insertWidget(int index, QWidget *widget) override;
37 bool canRemove(int) const override { return true; }
38 void remove(int index) override;
39
40private:
41 QWizard *m_wizard;
42};
43
44// QWizardPagePropertySheet: Introduces a attribute string fake property
45// "pageId" that allows for specifying enumeration values (uic only).
46// This breaks the pattern of having a "currentSth" property for the
47// container, but was deemed to make sense here since the Page has
48// its own "title" properties.
50{
52public:
54
55 bool reset(int index) override;
56
57 static const char *pageIdProperty;
58
59private:
60 const int m_pageIdIndex;
61};
62
63// QWizardPropertySheet: Hides the "startId" property. It cannot be used
64// as QWizard cannot handle setting it as a property before the actual
65// page is added.
66
68{
70public:
71 explicit QWizardPropertySheet(QWizard *object, QObject *parent = nullptr);
72 bool isVisible(int index) const override;
73
74private:
75 const QString m_startId;
76};
77
78// Factories
80using QWizardPagePropertySheetFactory = QDesignerPropertySheetFactory<QWizardPage, QWizardPagePropertySheet>;
82} // namespace qdesigner_internal
83
84QT_END_NAMESPACE
85
86#endif // QWIZARD_CONTAINER_H
virtual bool dynamicPropertiesAllowed() const =0
virtual bool isDynamicProperty(int index) const =0
virtual int addDynamicProperty(const QString &propertyName, const QVariant &value)=0
virtual bool canAddDynamicProperty(const QString &propertyName) const =0
virtual bool removeDynamicProperty(int index)=0
virtual ~QDesignerDynamicPropertySheetExtension()=default
QDesignerPropertySheetFactory(QExtensionManager *parent=nullptr)
static void registerExtension(QExtensionManager *mgr)
friend class QWidget
Definition qpainter.h:421
FormEditorOptionsPage(QDesignerFormEditorInterface *core)
QWidget * createPage(QWidget *parent) override
FormEditor(const QStringList &pluginPaths, QObject *parent=nullptr)
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void addWidget(QWidget *widget) override
static void positionNewMdiChild(const QWidget *area, QWidget *mdiChild)
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void setProperty(int index, const QVariant &value) override
static bool checkProperty(const QString &propertyName)
QVariant property(int index) const override
void addWidget(QWidget *widget) override
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
bool isVisible(int index) const override
QWidget * createPage(QWidget *parent) override
static QString chooseTemplatePath(QDesignerFormEditorInterface *core, QWidget *parent)
#define QT_FORMEDITOR_EXPORT
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QDESIGNER_SHARED_EXPORT