×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    3

    Harmattan N9 - ScreenOrietationLock

    Hello people,

    I'm trying to make an app in QT (harmattan for N9) and the simulator only have the Portrait simulator, you know how I can make my app LandscapeOrientation?

    My best try only get this (content is lanscape but the phone is locked portrait):



    It works on the phone but I cannot use the simulator, anyone with the same problem? in the capture you can read "N9 (landscape)" I tried to create my own device but didn't work either

    Thanks in advance
    Miguel

  2. #2
    Registered User
    Join Date
    Jan 2012
    Posts
    3

    Re: Harmattan N9 - ScreenOrietationLock

    I tried also the MOST BASIC example: http://harmattan-dev.nokia.com/docs/...ndscape&sp=all

    Page {
    id: mainPage
    ...
    orientationLock: PageOrientation.LockLandscape
    ...
    }


    and I get this:


  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: Harmattan N9 - ScreenOrietationLock

    Some people have a filed a bug as well for this issue, & of course it works well on device:

    http://developer.qt.nokia.com/forums/viewthread/9878
    http://developer.qt.nokia.com/forums/viewthread/8173

  4. #4
    Registered User
    Join Date
    Nov 2011
    Posts
    8

    Re: Harmattan N9 - ScreenOrietationLock

    I have the rotational problem as well (I want portrait but am stuck with landscape), but it happens both with QEMU and on the N9. It's a HTML5 project.

    I use it like this:

    Html5ApplicationViewer viewer;
    viewer.setOrientation(Html5ApplicationViewer::ScreenOrientationLockPortrait);
    viewer.showExpanded();
    viewer.loadFile(QLatin1String("htdocs/index.html"));

    But it always renders the HTML page in landscape mode, but I want it locked to portrait. In the bugs referred to it's mentioned to work on the device, but not for me. What should I do? I'm all new to Qt.

    Edit: I should mention that it behaves like this with the generated HTML5 project in Qt Creator as well. And using CSS to rotate the view as mentioned as a hack solution in some places is not an option as I use touch swiping in my javascript code, and I guess that would break then.

    Thanks,
    Per
    Last edited by cagecurrent; 2012-02-02 at 07:10.

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Harmattan N9 - ScreenOrietationLock

    Hi,
    Html5ApplicationViewer class on Qt 1.1.4 doesn't really change orientation on Harmattan, since it makes use of some extensions which are not available on the Meego window manager.

    To fix this issue you have to
    1. Create a new QML harmattan component-based project.
    2. Remove MainPage.qml
    3. Use a code like this for the main.qml

    import QtQuick 1.1
    import com.nokia.meego 1.0
    import QtWebKit 1.0

    PageStackWindow {
    id: appWindow

    initialPage: mainPage

    Page {
    id: mainPage
    //orientationLock: PageOrientation.LockPortrait

    Flickable {
    anchors.fill: parent
    ...

    WebView {
    id: webView
    anchors.fill: parent
    url: "yourpage.html"
    }
    }
    }

    ToolBarLayout {
    id: commonTools
    visible: false
    }
    }

    Code above is not full working. At least to get flickable and zoom (if you need it), please check this page http://doc.qt.nokia.com/4.7-snapshot...bview-qml.html

    More info about rotatin QWidget based apps (as your) at http://www.developer.nokia.com/Commu...d_applications
    Last edited by gnuton; 2012-02-02 at 10:39.

  6. #6
    Registered User
    Join Date
    Nov 2011
    Posts
    8

    Re: Harmattan N9 - ScreenOrietationLock

    Thanks!
    /Per

  7. #7
    Registered User
    Join Date
    Jan 2012
    Posts
    3

    Re: Harmattan N9 - ScreenOrietationLock

    I understand there's a bug... is there any other simulator to use? I'm in Hong Kong and the N9 is not available here so I can't have one, I'm using the RDA devices but it takes me 15 minutes each try... it's a lot of time if I only change one shape one pixel and I want to see how it looks

    Any other simulator?

  8. #8
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Harmattan N9 - ScreenOrietationLock

    Well more than a bug I can call it a missing feature! You have almost the same problem if you want to run a QML Desktop application on Harmattan.
    You could use emulator too (QEMU), but RDA is the best one if you don\t have any device.

Similar Threads

  1. Harmattan Platform API vs. Meego 1.2 Harmattan Platform API
    By cycnus in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2011-08-11, 10:04
  2. obs harmattan areas
    By inean in forum Nokia N9
    Replies: 2
    Last Post: 2011-07-01, 15:52
  3. Forum for N9 Harmattan SDK
    By kalinga_ray in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2011-06-30, 14:40
  4. Resources on Harmattan
    By goshakkk in forum Nokia N9
    Replies: 5
    Last Post: 2011-06-23, 13:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •