Modernize API usage

This commit is contained in:
2025-11-23 11:11:23 +01:00
parent cbc2b4b320
commit 1978dbf52d
5 changed files with 13 additions and 15 deletions

View File

@@ -42,7 +42,7 @@ BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, P
connect(m_ui->lineEditName, &QLineEdit::textChanged,
this, &BackgroundPropertiesDialog::changed);
connect(m_ui->checkBoxTileset, &QCheckBox::stateChanged,
connect(m_ui->checkBoxTileset, &QCheckBox::checkStateChanged,
this, &BackgroundPropertiesDialog::changed);
}

View File

@@ -688,7 +688,7 @@ void GameInformationDialog::textItalic()
void GameInformationDialog::textFamily(const QString &f)
{
QTextCharFormat fmt;
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
mergeFormatOnWordOrSelection(fmt);
}

View File

@@ -70,21 +70,21 @@ SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &pro
this, &SoundPropertiesDialog::changed);
connect(m_ui->radioButtonMultimedia, &QRadioButton::toggled,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxChorus, &QCheckBox::stateChanged,
connect(m_ui->checkBoxChorus, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxFlanger, &QCheckBox::stateChanged,
connect(m_ui->checkBoxFlanger, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxGargle, &QCheckBox::stateChanged,
connect(m_ui->checkBoxGargle, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxEcho, &QCheckBox::stateChanged,
connect(m_ui->checkBoxEcho, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxReverb, &QCheckBox::stateChanged,
connect(m_ui->checkBoxReverb, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->horizontalSliderVolume, &QSlider::valueChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->horizontalSliderPan, &QSlider::valueChanged,
this, &SoundPropertiesDialog::changed);
connect(m_ui->checkBoxPreload, &QCheckBox::stateChanged,
connect(m_ui->checkBoxPreload, &QCheckBox::checkStateChanged,
this, &SoundPropertiesDialog::changed);
}

View File

@@ -55,9 +55,9 @@ SpritePropertiesDialog::SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel
this, &SpritePropertiesDialog::changed);
connect(m_ui->spinBoxOriginY, &QSpinBox::valueChanged,
this, &SpritePropertiesDialog::changed);
connect(m_ui->checkBoxPreciseCollisionChecking, &QCheckBox::stateChanged,
connect(m_ui->checkBoxPreciseCollisionChecking, &QCheckBox::checkStateChanged,
this, &SpritePropertiesDialog::changed);
connect(m_ui->checkBoxSeparateCollisionMasks, &QCheckBox::stateChanged,
connect(m_ui->checkBoxSeparateCollisionMasks, &QCheckBox::checkStateChanged,
this, &SpritePropertiesDialog::changed);
}

View File

@@ -6,6 +6,7 @@
#include <QMouseEvent>
#include <algorithm>
#include <ranges>
#include "editorguiutils.h"
@@ -106,11 +107,8 @@ void PathPointsWidget::paintEvent(QPaintEvent *event)
painter.drawLine(point0.point, point1.point);
};
std::adjacent_find(std::cbegin(*m_points), std::cend(*m_points),
[&](const Path::Point &point0, const Path::Point &point1){
drawLine(point0, point1);
return false;
});
for (auto&& [p0, p1] : std::views::adjacent<2>(*m_points))
drawLine(p0, p1);
if (m_closed && m_points->size() >= 2)
drawLine(m_points->back(), m_points->front());