November 24, 2010

Tommi Laukkanen Tommi Laukkanen
Lab Rat
35 posts

Portrait QML apps on N900?

 

Is there a way to view QML apps in portrait mode on Nokia N900 with current version of QMLViewer? It doesn’t rotate automatically and the “Set orientation: Portrait” option doesn’t do anything.

 Signature 

My Blog: substanceofcode.com
Twitter: twitter.com/tlaukkanen

11 replies

November 25, 2010

fcrochik fcrochik
Lab Rat
517 posts

After loading qml viewer you can press CTRL+Shift+R to force the autorotation.

Another good option is to use qt creator 2.1 to create a simple wrapper around your qml application or just a generic “viewer” that will load any qml file.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

November 25, 2010

mutaphysis mutaphysis
Lab Rat
17 posts

You have to tell your main.qml to resize the actual window size matching the orientation.

Maybe the runtime [doc.qt.nokia.com] object would help you for that.

November 25, 2010

Tommi Laukkanen Tommi Laukkanen
Lab Rat
35 posts

Thanks for the replies. CTRL+Shift+R did the trick.

I am using

  1. anchors.fill: parent
so window resizes nicely when orientation is changed.

 Signature 

My Blog: substanceofcode.com
Twitter: twitter.com/tlaukkanen

November 26, 2010

fcrochik fcrochik
Lab Rat
517 posts

Glad to hear. It is probably a good idea to file a bug report if there is none.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

November 26, 2010

Tobias Hunger Tobias Hunger
Mad Scientist
3135 posts

fcrochik: A bug report about what? I think I am missing the issue in this post:-(

November 26, 2010

fcrochik fcrochik
Lab Rat
517 posts
Tobias Hunger wrote:
fcrochik: A bug report about what? I think I am missing the issue in this post:-(

That changing the orientation to portrait on the qml viewer running on the n900 does not have any effect.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

December 2, 2010

thp thp
Lab Rat
35 posts

If you create a C++ or Python wrapper for your QML app, you can use the Maemo 5-specific attributes “Qt::WA_Maemo5PortraitOrientation” and “Qt::WA_Maemo5AutoOrientation” on your QWidget (e.g. QDeclarativeView or QMainWindow), as described in this example:

http://gutenberg.troll.no/qt-maemo-4.7/maemo5-rotation.html

This way, you don’t have to press Ctrl+Shift+R every time you start your application and you can force portrait-only mode if you want (Ctrl+Shift+R only enables auto-rotation). Obviously, this only applies if you are writing a small C++/Python wrapper and load your QML file in a QDeclarativeView, and not if you are only using the QML Viewer.

December 2, 2010

QtK QtK
Lab Rat
1140 posts
fcrochik wrote:
Tobias Hunger wrote:
fcrochik: A bug report about what? I think I am missing the issue in this post:-(

That changing the orientation to portrait on the qml viewer running on the n900 does not have any effect.

In this case the window resizes properly right. So how is this a bug?

December 2, 2010

fcrochik fcrochik
Lab Rat
517 posts

Does it? It doesn’t on my n900 and I assume it didn’t for Tommi either or he would not have started this thread.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

December 3, 2010

thp thp
Lab Rat
35 posts
fcrochik wrote:
Does it? It doesn’t on my n900 and I assume it didn’t for Tommi either or he would not have started this thread.

Report a bugs on bugs.maemo.org then on the package and post instructions on how to reliably reproduce the error :) (I guess the Maemo build of qmlviewer has a special component on bugs.maemo.org, but it could be the normal Qt bugtracker as well)

December 3, 2010

fcrochik fcrochik
Lab Rat
517 posts

@thp: That was my suggestion to the author of this thread (with not so much detail I have to say… thanks for that)

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

 
  ‹‹ Qt Creator download out-of-date      Strings in QML/QtQuick/Qt ››

You must log in to post a reply. Not a member yet? Register here!