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
default_extensionfactory.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 DEFAULT_EXTENSIONFACTORY_H
6#define DEFAULT_EXTENSIONFACTORY_H
7
8#include <QtDesigner/extension_global.h>
9#include <QtDesigner/extension.h>
10
11#include <QtCore/qmap.h>
12#include <QtCore/qhash.h>
13#include <QtCore/qpair.h>
14
15QT_BEGIN_NAMESPACE
16
17class QExtensionManager;
18
19class QDESIGNER_EXTENSION_EXPORT QExtensionFactory : public QObject, public QAbstractExtensionFactory
20{
21 Q_OBJECT
22 Q_INTERFACES(QAbstractExtensionFactory)
23public:
24 explicit QExtensionFactory(QExtensionManager *parent = nullptr);
25
26 QObject *extension(QObject *object, const QString &iid) const override;
27 QExtensionManager *extensionManager() const;
28
29private Q_SLOTS:
30 void objectDestroyed(QObject *object);
31
32protected:
33 virtual QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
34
35private:
36 mutable QMap<std::pair<QString, QObject *>, QObject *> m_extensions;
37 // ### FIXME Qt 7: Use QSet, add out of line destructor.
38 mutable QHash<QObject*, bool> m_extended;
39};
40
41QT_END_NAMESPACE
42
43#endif // DEFAULT_EXTENSIONFACTORY_H
The QExtensionFactory class allows you to create a factory that is able to make instances of custom e...
Combined button and popup list for selecting options.