mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-20 14:54:14 +02:00
Replacing depreciated qAsConst with std::as_const
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const QString SETTINGS_GROUP = QStringLiteral("shortcuts/");
|
const QString SETTINGS_GROUP = QStringLiteral("shortcuts/");
|
||||||
@@ -143,7 +144,7 @@ void ShortcutManager::setSequence(const QString &id, const QKeySequence &sequenc
|
|||||||
settings.setValue(key, sequence.toString());
|
settings.setValue(key, sequence.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const QPointer<QObject> &target : qAsConst(it->targets)) {
|
for (const QPointer<QObject> &target : std::as_const(it->targets)) {
|
||||||
if (target) {
|
if (target) {
|
||||||
target->setProperty("shortcut", QVariant::fromValue(sequence));
|
target->setProperty("shortcut", QVariant::fromValue(sequence));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ShortcutsConfigPage::ShortcutsConfigPage
|
@brief ShortcutsConfigPage::ShortcutsConfigPage
|
||||||
@@ -198,7 +199,7 @@ void ShortcutsConfigPage::resetRow(int row_index)
|
|||||||
|
|
||||||
void ShortcutsConfigPage::resetAllRows()
|
void ShortcutsConfigPage::resetAllRows()
|
||||||
{
|
{
|
||||||
for (const Row &row : qAsConst(m_rows)) {
|
for (const Row &row : std::as_const(m_rows)) {
|
||||||
row.edit->setKeySequence(row.default_sequence);
|
row.edit->setKeySequence(row.default_sequence);
|
||||||
}
|
}
|
||||||
checkConflicts();
|
checkConflicts();
|
||||||
@@ -211,7 +212,7 @@ void ShortcutsConfigPage::resetAllRows()
|
|||||||
*/
|
*/
|
||||||
void ShortcutsConfigPage::applyConf()
|
void ShortcutsConfigPage::applyConf()
|
||||||
{
|
{
|
||||||
for (const Row &row : qAsConst(m_rows)) {
|
for (const Row &row : std::as_const(m_rows)) {
|
||||||
ShortcutManager::instance().setSequence(row.id, row.edit->keySequence());
|
ShortcutManager::instance().setSequence(row.id, row.edit->keySequence());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user