Merge pull request #5471 from vitor-k/misc

Fix some warnings and some small changes
This commit is contained in:
bunnei 2021-04-23 22:54:00 -07:00 committed by GitHub
commit 24086d05bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 110 additions and 117 deletions

View file

@ -61,7 +61,8 @@ void ConfigureAudio::SetConfiguration() {
SetAudioDeviceFromDeviceID();
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching);
ui->volume_slider->setValue(Settings::values.volume * ui->volume_slider->maximum());
ui->volume_slider->setValue(
static_cast<int>(Settings::values.volume * ui->volume_slider->maximum()));
SetVolumeIndicatorText(ui->volume_slider->sliderPosition());
int selection;

View file

@ -184,7 +184,7 @@ void ConfigureCamera::StartPreviewing() {
ui->preview_box->setHidden(false);
ui->preview_button->setHidden(true);
preview_width = ui->preview_box->size().width();
preview_height = preview_width * 0.75;
preview_height = static_cast<int>(preview_width * 0.75);
ui->preview_box->setToolTip(
tr("Resolution: %1*%2")
.arg(QString::number(preview_width), QString::number(preview_height)));
@ -232,7 +232,7 @@ void ConfigureCamera::timerEvent(QTimerEvent* event) {
}
std::vector<u16> frame = previewing_camera->ReceiveFrame();
int width = ui->preview_box->size().width();
int height = width * 0.75;
int height = static_cast<int>(width * 0.75);
if (width != preview_width || height != preview_height) {
StopPreviewing();
return;

View file

@ -256,7 +256,7 @@ ConfigureInput::ConfigureInput(QWidget* parent)
}
});
connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged, [=] {
const float slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value();
const int slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value();
if (analogs_param[analog_id].Get("engine", "") == "sdl") {
analog_map_deadzone_and_modifier_slider_label[analog_id]->setText(
tr("Deadzone: %1%").arg(slider_value));

View file

@ -168,10 +168,10 @@ void ConfigureMotionTouch::UpdateUiDisplay() {
void ConfigureMotionTouch::ConnectEvents() {
connect(ui->motion_provider,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int index) { UpdateUiDisplay(); });
[this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
connect(ui->touch_provider,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int index) { UpdateUiDisplay(); });
[this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest);
connect(ui->touch_calibration_config, &QPushButton::clicked, this,
&ConfigureMotionTouch::OnConfigureTouchCalibration);

View file

@ -326,7 +326,8 @@ void ConfigureTouchFromButton::OnBindingChanged(QStandardItem* item) {
}
}
void ConfigureTouchFromButton::OnBindingDeleted(const QModelIndex& parent, int first, int last) {
void ConfigureTouchFromButton::OnBindingDeleted([[maybe_unused]] const QModelIndex& parent,
int first, int last) {
for (int i = first; i <= last; ++i) {
auto ix = binding_list_model->index(i, 0);
if (!ix.isValid()) {
@ -513,7 +514,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) {
}
}
void TouchScreenPreview::leaveEvent(QEvent* event) {
void TouchScreenPreview::leaveEvent([[maybe_unused]] QEvent* event) {
if (coord_label) {
coord_label->clear();
}