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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Developer
Posts: 51
Registered: ‎04-15-2013
My Device: Z10
My Carrier: T-Mobile

Screen rotates when virtual keyboard shows up (Qt components)

Hi everybody,


I am porting one of my applications from Symbian/MeeGo to BB10 (Z10), and for now I've chosen to use Qt Components.  Everything works perfectly on the Z10 except for one problem I am unable to find solution for:


My application works in portrait mode. All pages are shown correctly, but one page contains a TextArea element to enter some text.  Whenever I tap on it, when the virtual keyboard shows up, the page automatically rotates by 90 degrees (to landscape mode). Only page contents rotate - the virtual keyboard remains in portrait.


I have



in bar-descriptor.xml, I also have


orientationLock: PageOrientation.LockPortrait

in the actual qml file,  and



in main.cpp...


to no avail, that page still rotates to landscape whenever the virtual keyboard pops up.   I've also tried all possible combinations of the above (e.g. removing orientation lock from the qml code, or from the main.cpp, etc.)  Nothing helps.


Just for test, I changed the orientation of that page to landscape, and in such case if I tap on the TextArea and the keyboard shows up (in landscape) then the page contents remain in landscape - there is no rotation. So for some reason it only happens in portrait....


I've noticed that when the page is in portrait (before the virtual keyboard opens) QtCreator shows a message that 1280x768 screen mode is used:


DISPLAY CONFIG: "1280" x "768" @ "210" 
DISPLAY: Trying to load: ":/params/layouts/1280_768_210.params" 
DISPLAY: Loading ":/params/layouts/1280_768_210.params"

 but when I tap the TextArea and the virtual keyboard is shown, the screen mode changes to 768x629...


DISPLAY CONFIG: "768" x "629" @ "210" 
DISPLAY: Trying to load: ":/params/layouts/768_629_210.params" 
DISPLAY: Loading fallback.params 

... or sometimes 768x758 if the virtual keyboard shows up without the digits row.



Can someone PLEASE help me to find a solution to prevent this page getting rotated and the screen mode changed when the virtual keyboard opens?    This is the LAST thing to do and if I can fix it I'd be able to publish my application....

Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: Screen rotates when virtual keyboard shows up (Qt components)

Hi there,


Can you confirm that you are using a standard Qt component and not Cascades?  

Pratik Sapra
Gaming & Apps Consultant
Developer Relations
New Developer
Posts: 51
Registered: ‎04-15-2013
My Device: Z10
My Carrier: T-Mobile

Re: Screen rotates when virtual keyboard shows up (Qt components)

Hi Pratik,

Thank you for your response.


In that application I am not using Cascades at all (there is no cascades import in any of the qml files).

I am using standard Qt components as well as the Nokia Symbian extras components someone ported to BB10.


That page shows up correctly in portrait and stays so until I tap on the TextArea field, which opens the virtual keyboard. A second or two after the keyboard opens the page gets rotated to landscape, while the keyboard itself stays in portrait...


The whole code of that qml file is too big to paste here, but its structure is basically something like that:


Page {

ButtonRow {
// some buttons
} Text { //some text } TextArea {
// some text input from the user } Button { // a button to confirm the input in the text area } }


New Developer
Posts: 51
Registered: ‎04-15-2013
My Device: Z10
My Carrier: T-Mobile

Re: Screen rotates when virtual keyboard shows up (Qt components)

OK, while I still don't know what triggers that undesired page rotation when the VKB opens, I found a simple workaround for it, so I'm posting it here in case someone ever experiences a similar issue.


It looks that it has something to do with PageStackWindow as it only happens if it is used. If a single page is used (not in a stack) with the very same elements, nothing gets rotated.


In the Qt components imports, in Window.qml one can find what is responsible for window rotation.  I simply changed window.rotation to a fixed '0' value (instead of a variable) and the page does not get rotated anymore.  Not a perfect solution, but for an application that only uses Portrait mode anyway and thus it does not need any window rotation, it simply does the job.