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
Regular Contributor
beemaster
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition

Can not set landscape orientation in Qt application

Hi,

 

I have simple Qt application, which I want to run on BlackBerry 10

 

QApplication app(argc, argv);

Widget w;
w.showFullScreen();

return app.exec();

 Widget is a subclass of QWidget with reimplemented paintEvent function. I am using QPainter to draw. My application always runs in portrait mode. My bar-descriptor.xml is correct though.

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

 What could be the problem and how to solve it?

Regular Contributor
beemaster
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition

Re: Can not set landscape orientation in Qt application

Found this thread http://supportforums.blackberry.com/t5/Native-Development/Qt-Creator-2-6-1-QML-app-landscape-orienta...

w.setAttribute(Qt::WA_LockLandscapeOrientation);

 helps, but if you rotate the device upside down (180 deg), it doesn't rotate. Any thoughts?