From 8f13d46c32847bd10e9c51e78b364854008d3077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Dillau?= Date: Tue, 7 Dec 2021 13:06:04 +0100 Subject: [PATCH] Selective workaround --- mainwindow.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 04cb4aa..51ad715 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -59,6 +59,9 @@ #include #include +#include +#include + MainWindow::MainWindow(QWidget *parent) : QWidget(parent), scene(new QGraphicsScene(this)) , h1Splitter(new QSplitter(this)), h2Splitter(new QSplitter(this)) @@ -95,8 +98,21 @@ MainWindow::MainWindow(QWidget *parent) m_screen = QGuiApplication::primaryScreen(); qDebug() << "Available geo: " << m_screen->availableGeometry() ; - connect(m_screen, &QScreen::orientationChanged, - this, &MainWindow::onOrientationChanged); + { + struct utsname sysInfo; + QMap models{ + {"iPad13,1", "iPad4"} // "iPad13,1" identifies iPad Air 4th generation + }; + + uname(&sysInfo); + QString machine(sysInfo.machine); + + if (models.contains(machine)) { + qDebug() << "Setup workaround for" << models[machine]; + connect(m_screen, &QScreen::orientationChanged, + this, &MainWindow::onOrientationChanged); + } + } } // HACK -- 2.30.1 (Apple Git-130)