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