×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    40

    get rotation information on N950and N9 - qt Widget

    hi,
    I developed a application with QWidget. Now i have to port it to the new device n950 (n9).
    The appliation stay allways in the lanscape mode. And ist not rotating with rotation the device.
    Is ist possible to activate rotating, and/or to get the information after rotate the screen?
    THx paul

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: get rotation information on N950and N9 - qt Widget

    The only supported method for orientation on MeeGo 1.2 Harmattan is through QtQuick.

    That said, there is a workaround in the form of embedding QWidget based UIs in QML through the QGraphicsProxyWidget class. To achieve this, you need to create a wrapper QML project with Window {} or PageStackWindow {} elements, and put your UI in it as a QML element. Note that using this workaround has known issues with layouting, performance and no system specific styling will be applied to the QWidgets used this way. For an example how to do this, see

    http://doc.qt.nokia.com/4.7-snapshot...-qwidgets.html

    (The example uses a QPushButton, but you could use any QWidget based class). Let me know if you need additional help with this.

  3. #3
    Regular Contributor
    Join Date
    Sep 2010
    Posts
    150

    Re: get rotation information on N950and N9 - qt Widget

    Quote Originally Posted by achipa View Post
    The only supported method for orientation on MeeGo 1.2 Harmattan is through QtQuick.

    That said, there is a workaround in the form of embedding QWidget based UIs in QML through the QGraphicsProxyWidget class. To achieve this, you need to create a wrapper QML project with Window {} or PageStackWindow {} elements, and put your UI in it as a QML element. Note that using this workaround has known issues with layouting, performance and no system specific styling will be applied to the QWidgets used this way. For an example how to do this, see

    http://doc.qt.nokia.com/4.7-snapshot...-qwidgets.html

    (The example uses a QPushButton, but you could use any QWidget based class). Let me know if you need additional help with this.
    I am facing almost the same problem. I need to launch and lock application in portrait mode regardless of phone orientation. Application is based on QWidgets.
    My application is Qt C++ one without using qml stuff. How I should solve this rotation problem then?

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: get rotation information on N950and N9 - qt Widget

    As said, you don't. There is no orientation setting support for QWidgets-based UIs in MeeGo 1.2 Harmattan (you're locked to landscape and that's it). You *have* to use QtQuick components (=QML) at least as a wrapper (though if you just wrap QWidgets with a QGraphicsProxyWidget as per that link, you will still lack the styling).

    EDIT: That is not to say that you cannot provide a portrait-like mode *yourself*, see http://www.developer.nokia.com/Commu...an-orientation
    Last edited by achipa; 2011-09-21 at 11:01.

  5. #5
    Regular Contributor
    Join Date
    Sep 2010
    Posts
    150

    Re: get rotation information on N950and N9 - qt Widget

    That's weird. For me QtQuick is showstopper, bcs it is lot of Qt ui stuff to port and it is unacceptable for me. :-(

  6. #6
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: get rotation information on N950and N9 - qt Widget

    You have a ready example how to embed your existing QWIdgets based UI in to a QML wrapper. I'm not sure what the difficulty is. On a side note, QtQuick is the de-facto development method already on all mobile Qt platforms, and with Qt 5.0 that's going to apply to desktop, too (with widgets provided as a legacy module which may or may not be present on a platform).

Similar Threads

  1. Replies: 2
    Last Post: 2010-06-21, 21:37
  2. Replies: 3
    Last Post: 2010-05-28, 16:17
  3. Replies: 4
    Last Post: 2010-05-07, 11:14
  4. Get information from widget
    By uhm57 in forum Symbian
    Replies: 3
    Last Post: 2010-03-10, 06:29

Posting Permissions

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