Fix for QT 5.12

This commit is contained in:
Jon Beniston 2022-09-17 08:54:38 +01:00
parent 7b8ad1c6cf
commit 13ec843891
2 changed files with 24 additions and 0 deletions

View File

@ -471,7 +471,11 @@ void RemoteControlDeviceDialog::on_controlUp_clicked()
{
// Swap device info
DeviceDiscoverer::DeviceInfo *info = &m_deviceInfo[ui->device->currentIndex()];
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
info->m_controls.swap(row, row - 1);
#else
info->m_controls.swapItemsAt(row, row - 1);
#endif
}
}
}
@ -499,7 +503,11 @@ void RemoteControlDeviceDialog::on_controlDown_clicked()
{
// Swap device info
DeviceDiscoverer::DeviceInfo *info = &m_deviceInfo[ui->device->currentIndex()];
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
info->m_controls.swap(row, row + 1);
#else
info->m_controls.swapItemsAt(row, row + 1);
#endif
}
}
}
@ -585,7 +593,11 @@ void RemoteControlDeviceDialog::on_sensorUp_clicked()
{
// Swap device info
DeviceDiscoverer::DeviceInfo *info = &m_deviceInfo[ui->device->currentIndex()];
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
info->m_sensors.swap(row, row - 1);
#else
info->m_sensors.swapItemsAt(row, row - 1);
#endif
}
}
}
@ -613,7 +625,11 @@ void RemoteControlDeviceDialog::on_sensorDown_clicked()
{
// Swap device info
DeviceDiscoverer::DeviceInfo *info = &m_deviceInfo[ui->device->currentIndex()];
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
info->m_sensors.swap(row, row + 1);
#else
info->m_sensors.swapItemsAt(row, row + 1);
#endif
}
}
}

View File

@ -204,7 +204,11 @@ void RemoteControlSettingsDialog::on_deviceUp_clicked()
if (i == items.size() - 1)
{
ui->devices->setCurrentItem(items[i]);
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
m_devices.swap(row, row - 1);
#else
m_devices.swapItemsAt(row, row - 1);
#endif
}
}
}
@ -226,7 +230,11 @@ void RemoteControlSettingsDialog::on_deviceDown_clicked()
if (i == items.size() - 1)
{
ui->devices->setCurrentItem(items[i]);
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
m_devices.swap(row, row + 1);
#else
m_devices.swapItemsAt(row, row + 1);
#endif
}
}
}