summaryrefslogtreecommitdiffstats
path: root/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_extension_qextensionmanager.cpp
blob: 0b79dd60da111dd092d175a0a56150093a526ea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
        void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
        {
            if (initialized)
                return;

            auto *manager = formEditor->extensionManager();
            Q_ASSERT(manager != nullptr);

            manager->registerExtensions(new MyExtensionFactory(manager),
                                        Q_TYPEID(QDesignerTaskMenuExtension));

            initialized = true;
        }
//! [0]