diff options
Diffstat (limited to 'src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp')
-rw-r--r-- | src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 1ed2e9da2..1efc66064 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.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 "signalsloteditorwindow.h" #include "signalsloteditor_p.h" @@ -67,6 +42,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + // Add suitable form widgets to a list of objects for the signal slot // editor. Prevent special widgets from showing up there. static void addWidgetToObjectList(const QWidget *w, QStringList &r) @@ -427,7 +404,7 @@ void InlineEditorModel::addTitle(const QString &title) const int cnt = rowCount(); insertRows(cnt, 1); QModelIndex cat_idx = index(cnt, 0); - setData(cat_idx, QString(title + QLatin1Char(':')), Qt::DisplayRole); + setData(cat_idx, QString(title + u':'), Qt::DisplayRole); setData(cat_idx, TitleItem, Qt::UserRole); QFont font = QApplication::font(); font.setBold(true); @@ -456,16 +433,13 @@ void InlineEditorModel::addTextList(const QMap<QString, bool> &text_list) QFont font = QApplication::font(); font.setItalic(true); QVariant fontVariant = QVariant::fromValue(font); - QMap<QString, bool>::ConstIterator it = text_list.constBegin(); - const QMap<QString, bool>::ConstIterator itEnd = text_list.constEnd(); - while (it != itEnd) { + for (auto it = text_list.cbegin(), itEnd = text_list.cend(); it != itEnd; ++it) { const QModelIndex text_idx = index(cnt++, 0); setData(text_idx, it.key(), Qt::DisplayRole); if (it.value()) { setData(text_idx, fontVariant, Qt::FontRole); setData(text_idx, QColor(Qt::red), Qt::ForegroundRole); } - ++it; } } @@ -645,7 +619,7 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, continue; // Mark deprecated members by passing bool=true. QMap<QString, bool> markedMemberList; - for (const QString &member : qAsConst(classInfo.m_memberList)) + for (const QString &member : std::as_const(classInfo.m_memberList)) markedMemberList.insert(member, false); inline_editor->addTitle(classInfo.m_className); inline_editor->addTextList(markedMemberList); @@ -707,11 +681,11 @@ SignalSlotEditorWindow::SignalSlotEditorWindow(QDesignerFormEditorInterface *cor QToolBar *toolBar = new QToolBar; toolBar->setIconSize(QSize(22, 22)); - m_add_button->setIcon(createIconSet(QStringLiteral("plus.png"))); + m_add_button->setIcon(createIconSet("plus.png"_L1)); connect(m_add_button, &QAbstractButton::clicked, this, &SignalSlotEditorWindow::addConnection); toolBar->addWidget(m_add_button); - m_remove_button->setIcon(createIconSet(QStringLiteral("minus.png"))); + m_remove_button->setIcon(createIconSet("minus.png"_L1)); connect(m_remove_button, &QAbstractButton::clicked, this, &SignalSlotEditorWindow::removeConnection); toolBar->addWidget(m_remove_button); |