/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** 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. ** ****************************************************************************/ #include "aspects.h" #include "algorithm.h" #include "fancylineedit.h" #include "layoutbuilder.h" #include "pathchooser.h" #include "qtcassert.h" #include "qtcprocess.h" #include "utilsicons.h" #include "variablechooser.h" #include #include #include #include #include #include #include #include #include #include #include namespace Utils { // BaseAspect BaseAspect::BaseAspect() = default; BaseAspect::~BaseAspect() = default; void BaseAspect::setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator) { m_configWidgetCreator = configWidgetCreator; } QWidget *BaseAspect::createConfigWidget() const { return m_configWidgetCreator ? m_configWidgetCreator() : nullptr; } void BaseAspect::addToLayout(LayoutBuilder &) { } // BaseAspects BaseAspects::BaseAspects() = default; BaseAspects::~BaseAspects() { qDeleteAll(base()); } BaseAspect *BaseAspects::aspect(Utils::Id id) const { return Utils::findOrDefault(base(), Utils::equal(&BaseAspect::id, id)); } void BaseAspects::fromMap(const QVariantMap &map) const { for (BaseAspect *aspect : *this) aspect->fromMap(map); } void BaseAspects::toMap(QVariantMap &map) const { for (BaseAspect *aspect : *this) aspect->toMap(map); } namespace Internal { class BoolAspectPrivate { public: BoolAspect::LabelPlacement m_labelPlacement = BoolAspect::LabelPlacement::AtCheckBox; bool m_value = false; bool m_defaultValue = false; bool m_enabled = true; QString m_labelText; QString m_tooltip; QPointer m_checkBox; // Owned by configuration widget QPointer m_label; // Owned by configuration widget }; class SelectionAspectPrivate { public: int m_value = 0; int m_defaultValue = 0; SelectionAspect::DisplayStyle m_displayStyle = SelectionAspect::DisplayStyle::RadioButtons; struct Option { QString displayName; QString tooltip; }; QVector