diff options
Diffstat (limited to 'src/designer/src/lib/extension/default_extensionfactory.cpp')
-rw-r--r-- | src/designer/src/lib/extension/default_extensionfactory.cpp | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/src/designer/src/lib/extension/default_extensionfactory.cpp b/src/designer/src/lib/extension/default_extensionfactory.cpp index af1fe6f21..87a8d1520 100644 --- a/src/designer/src/lib/extension/default_extensionfactory.cpp +++ b/src/designer/src/lib/extension/default_extensionfactory.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Designer of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "default_extensionfactory.h" #include "qextensionmanager.h" @@ -49,7 +24,7 @@ QT_BEGIN_NAMESPACE {QExtensionManager}{extension manager}. The QExtensionManager class provides extension management - facilities for Qt Designer. When an extension is required, Qt + facilities for \QD. When an extension is required, Qt Designer's \l {QExtensionManager}{extension manager} will run through all its registered factories calling QExtensionFactory::createExtension() for each until the first one @@ -57,7 +32,7 @@ QT_BEGIN_NAMESPACE object, is found. This factory will then make an instance of the extension. - There are four available types of extensions in Qt Designer: + There are four available types of extensions in \QD: QDesignerContainerExtension , QDesignerMemberSheetExtension, QDesignerPropertySheetExtension and QDesignerTaskMenuExtension. Qt Designer's behavior is the same whether the requested extension is @@ -78,8 +53,8 @@ QT_BEGIN_NAMESPACE For a complete example using the QExtensionFactory class, see the \l {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt - Designer, and how to to use the QDesignerTaskMenuExtension class - to add custom items to Qt Designer's task menu. + Designer, and how to use the QDesignerTaskMenuExtension class + to add custom items to \QD's task menu. \sa QExtensionManager, QAbstractExtensionFactory */ @@ -102,9 +77,9 @@ QObject *QExtensionFactory::extension(QObject *object, const QString &iid) const { if (!object) return nullptr; - const IdObjectKey key = qMakePair(iid, object); + const auto key = std::make_pair(iid, object); - ExtensionMap::iterator it = m_extensions.find(key); + auto it = m_extensions.find(key); if (it == m_extensions.end()) { if (QObject *ext = createExtension(object, iid, const_cast<QExtensionFactory*>(this))) { connect(ext, &QObject::destroyed, this, &QExtensionFactory::objectDestroyed); |