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