forked from eden-emu/eden
Qt6: Disable IR Sensor when compiling with Qt6
Gating the IR Sensor code behind a macro like so `#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA` The YUZU_USE_QT_MULTIMEDIA flag is implemented in later commit Also the locale fix in src/yuzu/main.cpp is now gated against Qt6, as it causes compilation error
This commit is contained in:
parent
405d685101
commit
ad3ee5c52b
6 changed files with 25 additions and 0 deletions
|
@ -2,8 +2,11 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <memory>
|
||||
#include <QtCore>
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
|
||||
#include <QCameraImageCapture>
|
||||
#include <QCameraInfo>
|
||||
#endif
|
||||
#include <QStandardItemModel>
|
||||
#include <QTimer>
|
||||
|
||||
|
@ -33,6 +36,7 @@ ConfigureCamera::ConfigureCamera(QWidget* parent, InputCommon::InputSubsystem* i
|
|||
ConfigureCamera::~ConfigureCamera() = default;
|
||||
|
||||
void ConfigureCamera::PreviewCamera() {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
|
||||
const auto index = ui->ir_sensor_combo_box->currentIndex();
|
||||
bool camera_found = false;
|
||||
const QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
|
||||
|
@ -101,6 +105,7 @@ void ConfigureCamera::PreviewCamera() {
|
|||
});
|
||||
|
||||
camera_timer->start(250);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConfigureCamera::DisplayCapturedFrame(int requestId, const QImage& img) {
|
||||
|
@ -133,11 +138,13 @@ void ConfigureCamera::LoadConfiguration() {
|
|||
ui->ir_sensor_combo_box->clear();
|
||||
input_devices.push_back("Auto");
|
||||
ui->ir_sensor_combo_box->addItem(tr("Auto"));
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
|
||||
const auto cameras = QCameraInfo::availableCameras();
|
||||
for (const QCameraInfo& cameraInfo : cameras) {
|
||||
input_devices.push_back(cameraInfo.deviceName().toStdString());
|
||||
ui->ir_sensor_combo_box->addItem(cameraInfo.description());
|
||||
}
|
||||
#endif
|
||||
|
||||
const auto current_device = Settings::values.ir_sensor_device.GetValue();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue