diff options
Diffstat (limited to 'src/designer/src/components/formeditor/qmdiarea_container.cpp')
-rw-r--r-- | src/designer/src/components/formeditor/qmdiarea_container.cpp | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp index 03fe667a3..137bd9618 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.cpp +++ b/src/designer/src/components/formeditor/qmdiarea_container.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 "qmdiarea_container.h" @@ -39,6 +14,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + namespace qdesigner_internal { QMdiAreaContainer::QMdiAreaContainer(QMdiArea *widget, QObject *parent) @@ -49,7 +26,7 @@ QMdiAreaContainer::QMdiAreaContainer(QMdiArea *widget, QObject *parent) int QMdiAreaContainer::count() const { - return m_mdiArea->subWindowList(QMdiArea::CreationOrder).count(); + return m_mdiArea->subWindowList(QMdiArea::CreationOrder).size(); } QWidget *QMdiAreaContainer::widget(int index) const @@ -129,26 +106,24 @@ void QMdiAreaContainer::remove(int index) // 1) window name (object name of child) // 2) title (windowTitle of child). -static const char *subWindowTitleC = "activeSubWindowTitle"; -static const char *subWindowNameC = "activeSubWindowName"; +static constexpr auto subWindowTitleC = "activeSubWindowTitle"_L1; +static constexpr auto subWindowNameC = "activeSubWindowName"_L1; QMdiAreaPropertySheet::QMdiAreaPropertySheet(QWidget *mdiArea, QObject *parent) : QDesignerPropertySheet(mdiArea, parent), - m_windowTitleProperty(QStringLiteral("windowTitle")) + m_windowTitleProperty(u"windowTitle"_s) { - createFakeProperty(QLatin1String(subWindowNameC), QString()); - createFakeProperty(QLatin1String(subWindowTitleC), QString()); + createFakeProperty(subWindowNameC, QString()); + createFakeProperty(subWindowTitleC, QString()); } QMdiAreaPropertySheet::MdiAreaProperty QMdiAreaPropertySheet::mdiAreaProperty(const QString &name) { - using MdiAreaPropertyHash = QHash<QString, MdiAreaProperty>; - static MdiAreaPropertyHash mdiAreaPropertyHash; - if (mdiAreaPropertyHash.isEmpty()) { - mdiAreaPropertyHash.insert(QLatin1String(subWindowNameC), MdiAreaSubWindowName); - mdiAreaPropertyHash.insert(QLatin1String(subWindowTitleC), MdiAreaSubWindowTitle); - } - return mdiAreaPropertyHash.value(name,MdiAreaNone); + static const QHash<QString, MdiAreaProperty> mdiAreaPropertyHash = { + {subWindowNameC, MdiAreaSubWindowName}, + {subWindowTitleC, MdiAreaSubWindowTitle} + }; + return mdiAreaPropertyHash.value(name, MdiAreaNone); } void QMdiAreaPropertySheet::setProperty(int index, const QVariant &value) |