[Android-development] orientationChanged() not propagated on Android.

ekke ekke at ekkes-corner.org
Fri Jun 24 12:31:59 CEST 2016


just did a short test (Qt 5.7, QuickControls2 APP)

tested Android 6.0.1 on BlackBerry PRIV:
orientation change works between Portrait and Landscape
but from Landscape to InvertedLandscape or from InvertedLandscape to
Landscape there was no signal
for me no problem - don't have to distinguish
InvertedPortrait couldn't be tested because my device doesn't allow this

tested on iOS 9.3 (iPhone 6s)
all signals are coming in

ciao

ekke

Am 24.06.16 um 11:40 schrieb Wiktor Grębla:
> Hi guys.
>
> I've been trying to use orientationChanged signal to react on
> orientation changes but somehow can't get it to work. 
>
> I've seen some old threads with similar reports (Qt-5.3) but I'm more
> keen to believe that I'm doing something wrong rather than it's not
> working.
>
> I've tried it on Qt-5.6 and now on Qt-5.7:
>
> #include"mainwindow.h"
> #include"ui_mainwindow.h"
> #include<QScreen>
> MainWindow::MainWindow(QWidget*parent):
> QMainWindow(parent),
> ui(newUi::MainWindow)
> {
> ui->setupUi(this);
> QScreen*screen=QGuiApplication::primaryScreen();
> connect(screen,SIGNAL(orientationChanged(Qt::ScreenOrientation)),this,SLOT(onRotate(Qt::ScreenOrientation)));
> screen->setOrientationUpdateMask(Qt::PortraitOrientation|Qt::LandscapeOrientation|Qt::InvertedPortraitOrientation|Qt::InvertedLandscapeOrientation);
> }
> voidMainWindow::onRotate(Qt::ScreenOrientation)
> {
> ui->label->setText("Rotated!");
> }
> MainWindow::~MainWindow()
> {
> deleteui;
> }
> I'll be grateful for any hints or suggestions.
> Cheers,
> W.
>
> -- 
> Talkers are no good doers.
>
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20160624/0fde3e55/attachment.html>


More information about the Android-development mailing list