[Interest] Using QtQuick 2.0 Screen.orientation

Jim Hodapp jim.hodapp at canonical.com
Mon Feb 25 23:11:41 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm attempting to be notified in my QML application of when the
underlying QScreen instance (one that I've implemented for my platform
as a QPA plugin) changes the orientation property. In my QPA plugin, I
am calling QWindowSystemInterface::handleScreenOrientationChange() any
time after I set the orientation, and have also implemented the
orientation() function. I call it like so:

QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(),
currentOrientation_);

On my QML side, I simply have a Rectangle, and inside that rectangle I
have the following signal handler:

Screen.onOrientationChanged: {
        console.log("*** Screen Orientation: " +
orientationEnumToText(orient));
    }

The only time I see this is immediately after my QML app is run using
qmlscene. The orientation value is the default value, namely
Qt.PrimaryOrientation. I'm confused why I'm not getting any other
signal calls from my QPA implementation in my QML app? I've also set
the orientationUpdateMask in my QPA plugin by calling
setOrientationUpdateMask() and passed it all 4 major orientations.

What else do I need to do to get my signal handler in my QML app to be
called every time the orientation changes in the QPA plugin?

Regards,

Jim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRK+GdAAoJENCYE0OpVkFTCFkIAKmqyHVS1LMm2k3VbbQM2hnW
QPoXLq4eUVY6UCiCWtXth4Nf1ZTziQCoBhlz4w0QANfj5KevcWD4NbuMXvqRBwJv
BHqwASTxFRsCdc03fD6jJu+w+2Xa3zs3BaJRc5c8YaKMqadM9EsFoGBTDWlf+cj1
835c6y1XggmzW94aq+lczMYgWcxHwodOOi6ITysn6RziUUkLdB/Gf/C3HzSVhV5n
IkBKG12cxnuYST67UEgr1F1rh7G+x7Qmdl3RMsAJeN3X1rjL/fCYx3YoCKlpOkPn
gBQwI6Qt6NmJJ/js7ocW01JdPf+4lHzDkXTeFlTnMZh8cwT59OWv3con7wO5Kts=
=DxNL
-----END PGP SIGNATURE-----



More information about the Interest mailing list