diff options
Diffstat (limited to 'src/assistant/help/qoptionswidget_p.h')
-rw-r--r-- | src/assistant/help/qoptionswidget_p.h | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/src/assistant/help/qoptionswidget_p.h b/src/assistant/help/qoptionswidget_p.h index a6700c1d7..a62fbe2c8 100644 --- a/src/assistant/help/qoptionswidget_p.h +++ b/src/assistant/help/qoptionswidget_p.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Assistant 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) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QOPTIONSWIDGET_H #define QOPTIONSWIDGET_H @@ -40,8 +15,8 @@ // We mean it. // -#include <QtWidgets/QWidget> -#include <QtCore/QMap> +#include <QtCore/qhash.h> +#include <QtWidgets/qwidget.h> QT_BEGIN_NAMESPACE @@ -54,11 +29,10 @@ class QOptionsWidget : public QWidget public: QOptionsWidget(QWidget *parent = nullptr); - void clear(); - void setOptions(const QStringList &validOptions, - const QStringList &selectedOptions); - QStringList validOptions() const; - QStringList selectedOptions() const; + void clear() { setOptions({}, {}); } + void setOptions(const QStringList &validOptions, const QStringList &selectedOptions); + QStringList validOptions() const { return m_validOptions; } + QStringList selectedOptions() const { return m_selectedOptions; } void setNoOptionText(const QString &text); void setInvalidOptionText(const QString &text); @@ -78,10 +52,10 @@ private: QStringList m_validOptions; QStringList m_invalidOptions; QStringList m_selectedOptions; - QMap<QString, QListWidgetItem *> m_optionToItem; - QMap<QListWidgetItem *, QString> m_itemToOption; + QHash<QString, QListWidgetItem *> m_optionToItem; + QHash<QListWidgetItem *, QString> m_itemToOption; }; QT_END_NAMESPACE -#endif // OPTIONSWIDGET_H +#endif // QOPTIONSWIDGET_H |