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
qaxwidgetplugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
9
10#include <QtDesigner/abstractformeditor.h>
11#include <QtDesigner/abstractformwindow.h>
12
13#include <QtCore/qplugin.h>
14#include <QtGui/qicon.h>
15#include <QtAxContainer/QAxWidget>
16
18
19using namespace Qt::StringLiterals;
20
21QAxWidgetPlugin::QAxWidgetPlugin(QObject *parent) :
22 QObject(parent)
23{
24}
25
27{
28 return u"QAxWidget"_s;
29}
30
32{
33 return u"Containers"_s;
34}
35
37{
38 return tr("ActiveX control");
39}
40
42{
43 return tr("ActiveX control widget");
44}
45
47{
48 return u"qaxwidget.h"_s;
49}
50
52{
53 return QIcon(QDesignerAxWidget::widgetIcon());
54}
55
57{
58 return false;
59}
60
62{
63 // Construction from Widget box or on a form?
64 const bool isFormEditor = parent != nullptr
65 && QDesignerFormWindowInterface::findFormWindow(parent) != nullptr;
66 auto rc = new QDesignerAxPluginWidget(parent);
67 if (!isFormEditor)
69 return rc;
70}
71
73{
74 return m_core != nullptr;
75}
76
77void QAxWidgetPlugin::initialize(QDesignerFormEditorInterface *core)
78{
79 if (m_core != nullptr)
80 return;
81
82 m_core = core;
83
84 QExtensionManager *mgr = core->extensionManager();
85 ActiveXPropertySheetFactory::registerExtension(mgr);
86 ActiveXTaskMenuFactory::registerExtension(mgr, Q_TYPEID(QDesignerTaskMenuExtension));
87 QAxWidgetExtraInfoFactory *extraInfoFactory = new QAxWidgetExtraInfoFactory(core, mgr);
88 mgr->registerExtensions(extraInfoFactory, Q_TYPEID(QDesignerExtraInfoExtension));
89}
90
92{
93 return QStringLiteral(R"(<ui language="c++">
94 <widget class="QAxWidget" name="axWidget">
95 <property name="geometry">
96 <rect>
97 <x>0</x>
98 <y>0</y>
99 <width>80</width>
100 <height>70</height>
101 </rect>
102 </property>
103 </widget>
104</ui>)");
105}
106
107QT_END_NAMESPACE
QString toolTip() const override
QString group() const override
bool isInitialized() const override
bool isContainer() const override
QString includeFile() const override
QString whatsThis() const override
QIcon icon() const override
QString domXml() const override
QWidget * createWidget(QWidget *parent) override
QString name() const override
void initialize(QDesignerFormEditorInterface *core) override
Combined button and popup list for selecting options.