From 1094e47756927e92083f4a853501374ed30f0ee4 Mon Sep 17 00:00:00 2001 From: elros34 Date: Fri, 17 Aug 2018 13:40:06 +0200 Subject: [PATCH] Configurable orientation mask --- main.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 783bd46..b425a1f 100644 --- a/main.cpp +++ b/main.cpp @@ -99,11 +99,15 @@ int main(int argc, char *argv[]) QScreen* sc = app.primaryScreen(); if(sc){ - sc->setOrientationUpdateMask(Qt::PrimaryOrientation - | Qt::LandscapeOrientation - | Qt::PortraitOrientation - | Qt::InvertedLandscapeOrientation - | Qt::InvertedPortraitOrientation); + QFlags mask = Qt::PrimaryOrientation + | Qt::PortraitOrientation + | Qt::LandscapeOrientation + | Qt::InvertedPortraitOrientation + | Qt::InvertedLandscapeOrientation; + if (settings->contains("ui/orientationMask")) { + mask &= settings->value("ui/orientationMask").toInt(); + } + sc->setOrientationUpdateMask(mask); } qmlRegisterType("FingerTerm", 1, 0, "TextRender");