Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
DevHell
Posts: 15
Registered: ‎02-24-2012
My Device: BlackBerry Z10
My Carrier: Orange

Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B

[ Edited ]

Hello guys,

I want to make a QML app in Qt Creator 2.6.1 in landscape mode. But I can't make the app stay in landscape mode. If I run it first time, it stays in landscape, but when I run it second time, third time, it is in portrait.

I've tried all the possible settings like setting the orientation in main.cpp with and

viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);

 

and setting the orientation in bar-descriptor.xml with:

    <initialWindow>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
        <autoOrients>false</autoOrients>
        <aspectRatio>landscape</aspectRatio>
    </initialWindow>

 but the problem is still there :smileysad:

I've tried different settings in main.cpp and bar-descriptor.xml, but the same thing happens.

Anyone succeded to make a landscape app for Dev Alpha B?

Any ideas why I can't make the app in landscape mode? Any bugs on the device?

 

LE: I have created a sample app which can be found here: https://dl.dropbox.com/u/46032438/landscapetest.zip

Qt rocks
Please use plain text.
BlackBerry Development Advisor (Retired)
kizkasen
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B

If you call showFullScreen instead of showExpanded, then it should work.
Please use plain text.
Contributor
DevHell
Posts: 15
Registered: ‎02-24-2012
My Device: BlackBerry Z10
My Carrier: Orange

Re: Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B


kizkasen wrote:
If you call showFullScreen instead of showExpanded, then it should work.

No, it does not work. It works only when you compile and run the app from the Qt Creator, but after that, when you run the app from the phone, it's still in portrait mode.

Qt rocks
Please use plain text.
Contributor
DevHell
Posts: 15
Registered: ‎02-24-2012
My Device: BlackBerry Z10
My Carrier: Orange

Re: Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B

Made a small step: if I add

CONFIG += cascades device

 in my pro file, call showFullScreen(); and set setAttribute(Qt::WA_LockLandscapeOrientation,true) in qmlapplicationviewer.cpp,

my app starts in landscape, but sometimes, my landscape is upside down. This is really annoying :smileysad: I can't figure out why is this happening. It seems that the Qt::WA_LockLandscapeOrientation attribute does not work on bb10, but as I've read in another topic, this was fixed in late oct. Can the Qt version from the device (4.8.4 build date 8 january 2013 - thanks to QtInfo app for the info) be different and not including the fix for the Qt::WA_LockLandscapeOrientation attribute?

Qt rocks
Please use plain text.
BlackBerry Development Advisor (Retired)
kizkasen
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B

Qt Creator (at least 2.7) templates for BlackBerry 10 have no orientation issues.
Please use 2.7 and test the basic hello world apps. Please advise us on the results.

Please use plain text.
Contributor
DevHell
Posts: 15
Registered: ‎02-24-2012
My Device: BlackBerry Z10
My Carrier: Orange

Re: Qt Creator 2.6.1 QML app - landscape orientation problem on Dev Alpha B

[ Edited ]

It seems to work, at least for me, in 99% of the cases the app launches as it should. But still, sometimes, very rare, it launches in portrait instead of landscape :smileyfrustrated:  Using viewer.showFullScreen(); instead of  viewer.showExpanded();

in the main.cpp file seems to work (or at least I wasn't able to reproduce the bug yet).

What was changed in this templates from Qt Creator 2.7.0? Because I haven't seen anything changed in the .pro or qmlapplicationviewer...

 

I'm using the latest NDK and the latest version of BB10 OS for DevAlpha

Qt rocks
Please use plain text.