5

Is there any definite guide how to make QWidget app portrait oriented on MeeGo Harmattan device?

I'm currently working on N950 (devel version of N9) and my app is in landscape mode all the time.

App was previously written as QApplication with QMainWindow

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244

2 Answers2

2

According to this Nokia documentation, QWidgets are not supported on Harmattan. I think there is some backward compatibility, but if you keep using QWidget you will not have full integration in the platform. This blog post also provides some guidance on porting a Qt application to Harmattan.

If you convert your application to QML, you will then be able to set the orientation lock:

Page{
    orientationLock: PageOrientation.LockPortrait
    ...

which should set your app in portrait mode.

Luc Touraille
  • 79,925
  • 15
  • 92
  • 137
  • problem is that our application is in current time way too complex to start porting it to QT Quick (QML), that's why I asked for support on working with QWidget on Harmattan. In QML is this goal well documented and simple to reach. – Marek Sebera Nov 25 '11 at 10:57
  • At least I accepted your answer, although you haven't provided solution for QWidget, looks like this is the only way we have to walk. – Marek Sebera Nov 30 '11 at 09:49
  • No sadness, maybe next time :)) – Marek Sebera Nov 30 '11 at 13:51
1

Ok so there is no way to do it using the api since it supports only QML, but some guy have found the solution here. I think this will solve your problem.

v01d
  • 1,457
  • 1
  • 11
  • 22
  • unfortunately this blogpost is not working anymore. I've tried this code on simple QWidget application, and it haven't worked at all – Marek Sebera Nov 25 '11 at 11:48
  • sorry to hear that. when i have some more time will test and see what could be done. – v01d Nov 25 '11 at 11:53
  • Hi, so have you discovered anything? Thanks – Marek Sebera Nov 29 '11 at 10:45
  • Nope i'm trying but now we have a lot of work on my workplace so i don't have a lot of time. I hope i'll be free in a days or two and will look at your problem. – v01d Nov 29 '11 at 10:56