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
containerwidget_taskmenu.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// Qt-Security score:significant reason:default
4
5#ifndef CONTAINERWIDGER_TASKMENU_H
6#define CONTAINERWIDGER_TASKMENU_H
7
8#include <qdesigner_taskmenu_p.h>
9#include <shared_enums_p.h>
10
11#include <extensionfactory_p.h>
12
13#include <QtCore/qpointer.h>
14
16
17class QDesignerFormWindowInterface;
18class QDesignerFormEditorInterface;
20class QAction;
21class QMdiArea;
22class QMenu;
23class QWizard;
24
25namespace qdesigner_internal {
26
27class PromotionTaskMenu;
28
29// ContainerWidgetTaskMenu: Task menu for containers with extension
30
32{
34public:
37
38 QAction *preferredEditAction() const override;
39 QList<QAction*> taskActions() const override;
40
41private slots:
42 void removeCurrentPage();
43 void addPage();
44 void addPageAfter();
45
46protected:
48 QList<QAction*> &containerActions() { return m_taskActions; }
49 int pageCount() const;
50
51private:
52 QDesignerFormWindowInterface *formWindow() const;
53
54private:
55 static QString pageMenuText(ContainerType ct, int index, int count);
56 bool canDeletePage() const;
57
58 const ContainerType m_type;
59 QWidget *m_containerWidget;
60 QDesignerFormEditorInterface *m_core;
61 PromotionTaskMenu *m_pagePromotionTaskMenu;
62 QAction *m_pageMenuAction;
63 QMenu *m_pageMenu;
64 QList<QAction*> m_taskActions;
65 QAction *m_actionInsertPageAfter;
66 QAction *m_actionInsertPage;
67 QAction *m_actionDeletePage;
68};
69
70// WizardContainerWidgetTaskMenu: Provide next/back since QWizard
71// has modes in which the "Back" button is not visible.
72
75public:
77
78 QList<QAction*> taskActions() const override;
79
80private:
81 QAction *m_nextAction;
82 QAction *m_previousAction;
83};
84
85
86// MdiContainerWidgetTaskMenu: Provide tile/cascade for MDI containers in addition
87
90public:
91 explicit MdiContainerWidgetTaskMenu(QMdiArea *m, QObject *parent = nullptr);
92
93 QList<QAction*> taskActions() const override;
94private:
95 void initializeActions();
96
97 QAction *m_nextAction = nullptr;
98 QAction *m_previousAction = nullptr;
99 QAction *m_tileAction = nullptr;
100 QAction *m_cascadeAction = nullptr;
101};
102
104{
106public:
108
109protected:
110 QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const override;
111
112private:
113 QDesignerFormEditorInterface *m_core;
114};
115
116} // namespace qdesigner_internal
117
118QT_END_NAMESPACE
119
120#endif // CONTAINERWIDGER_TASKMENU_H
friend class QWidget
Definition qpainter.h:432
QObject * createExtension(QObject *object, const QString &iid, QObject *parent) const override
Creates an extension specified by iid for the given object.
QDesignerContainerExtension * containerExtension() const
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.