1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Designer of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#include "taskmenu_component.h"
30#include "button_taskmenu.h"
31#include "groupbox_taskmenu.h"
32#include "label_taskmenu.h"
33#include "lineedit_taskmenu.h"
34#include "listwidget_taskmenu.h"
35#include "treewidget_taskmenu.h"
36#include "tablewidget_taskmenu.h"
37#include "containerwidget_taskmenu.h"
38#include "combobox_taskmenu.h"
39#include "textedit_taskmenu.h"
40#include "menutaskmenu.h"
41#include "toolbar_taskmenu.h"
42#include "layouttaskmenu.h"
43
44#include <QtDesigner/abstractformeditor.h>
45#include <QtDesigner/qextensionmanager.h>
46
47QT_BEGIN_NAMESPACE
48
49using namespace qdesigner_internal;
50
51TaskMenuComponent::TaskMenuComponent(QDesignerFormEditorInterface *core, QObject *parent)
52 : QObject(parent),
53 m_core(core)
54{
55 Q_ASSERT(m_core != nullptr);
56
57 QExtensionManager *mgr = core->extensionManager();
58 const QString taskMenuId = QStringLiteral("QDesignerInternalTaskMenuExtension");
59
60 ButtonTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
61 CommandLinkButtonTaskMenuFactory::registerExtension(mgr, iid: taskMenuId); // Order!
62 ButtonGroupTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
63
64 GroupBoxTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
65 LabelTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
66 LineEditTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
67 ListWidgetTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
68 TreeWidgetTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
69 TableWidgetTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
70 TextEditTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
71 PlainTextEditTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
72 MenuTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
73 MenuBarTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
74 ToolBarTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
75 StatusBarTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
76 LayoutWidgetTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
77 SpacerTaskMenuFactory::registerExtension(mgr, iid: taskMenuId);
78
79 mgr->registerExtensions(factory: new ContainerWidgetTaskMenuFactory(core, mgr), iid: taskMenuId);
80 mgr->registerExtensions(factory: new ComboBoxTaskMenuFactory(taskMenuId, mgr), iid: taskMenuId);
81}
82
83TaskMenuComponent::~TaskMenuComponent() = default;
84
85QDesignerFormEditorInterface *TaskMenuComponent::core() const
86{
87 return m_core;
88
89}
90QT_END_NAMESPACE
91
92

source code of qttools/src/designer/src/components/taskmenu/taskmenu_component.cpp