1
0
Fork 0

fix some conversion warnings

This commit is contained in:
Vitor Kiguchi 2020-07-24 16:33:09 -03:00
parent 3381a05f7c
commit 8e54e7cf1a
5 changed files with 7 additions and 7 deletions

View File

@ -230,8 +230,8 @@ void GRenderWindow::OnFramebufferSizeChanged() {
// Screen changes potentially incur a change in screen DPI, hence we should update the // Screen changes potentially incur a change in screen DPI, hence we should update the
// framebuffer size // framebuffer size
const qreal pixel_ratio = windowPixelRatio(); const qreal pixel_ratio = windowPixelRatio();
const u32 width = this->width() * pixel_ratio; const u32 width = static_cast<u32>(this->width() * pixel_ratio);
const u32 height = this->height() * pixel_ratio; const u32 height = static_cast<u32>(this->height() * pixel_ratio);
UpdateCurrentFramebufferLayout(width, height); UpdateCurrentFramebufferLayout(width, height);
} }

View File

@ -61,7 +61,7 @@ void ConfigureAudio::SetConfiguration() {
SetAudioDeviceFromDeviceID(); SetAudioDeviceFromDeviceID();
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching); 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()); SetVolumeIndicatorText(ui->volume_slider->sliderPosition());
int selection; int selection;

View File

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

View File

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

View File

@ -236,7 +236,7 @@ private:
template <SwizzlePattern::Selector (SwizzlePattern::*getter)(int) const> template <SwizzlePattern::Selector (SwizzlePattern::*getter)(int) const>
std::string GetSelectorSrc(const SwizzlePattern& pattern) { std::string GetSelectorSrc(const SwizzlePattern& pattern) {
std::string out; std::string out;
for (std::size_t i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
switch ((pattern.*getter)(i)) { switch ((pattern.*getter)(i)) {
case SwizzlePattern::Selector::x: case SwizzlePattern::Selector::x:
out += 'x'; out += 'x';