×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Question How to detect orientation in Qt 4.6.2?

    I'm trying to detect the device orientation in Qt 4.6.2. Qt::WA_Maemo5PortraitOrientation is no longer recognised. What should I use? I'm using the new Nokia Qt SDK Beta.

    Cheers

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by Sasler View Post
    I'm trying to detect the device orientation in Qt 4.6.2.
    You can listen for QDesktopWidget::resized(int screen) signal like in this example
    http://doc.qt.nokia.com/qt-maemo-4.6...-rotation.html

    Also I don't know why do you state that Qt::WA_Maemo5PortraitOrientation is not recognized in Qt 4.6.2.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    You can listen for QDesktopWidget::resized(int screen) signal like in this example
    http://doc.qt.nokia.com/qt-maemo-4.6...-rotation.html

    Also I don't know why do you state that Qt::WA_Maemo5PortraitOrientation is not recognized in Qt 4.6.2.
    This is what I was using, but I get:

    'WA_Maemo5PortraitOrientation' is not a member of 'Qt'

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by Sasler View Post
    This is what I was using, but I get:
    Did you add
    Code:
    QT += maemo5
    to your project file?

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    Did you add
    Code:
    QT += maemo5
    to your project file?
    Well... yes and now. I didn't but now I have and there is now difference. Same error.

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by Sasler View Post
    Well... yes and now. I didn't but now I have and there is now difference. Same error.
    Did you choose Maemo target in Nokia Qt SDK setup?
    In this documents, section 4.3 Set up Qt Creator:
    http://www.forum.nokia.com/info/sw.n...ia_Qt_SDK.html
    it actually tells about Symbian, but you should choose Maemo.

  7. #7
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    Did you choose Maemo target in Nokia Qt SDK setup?
    In this documents, section 4.3 Set up Qt Creator:
    http://www.forum.nokia.com/info/sw.n...ia_Qt_SDK.html
    it actually tells about Symbian, but you should choose Maemo.
    Yes, I did. The app runs fine when I remove that line. Both in the Qt Simulator and in the actual N900 device. I wonder if I'm using Qt 4.5.3 instead of 4.6.2?

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Could you please provide a screenshot of Projects Build Settings tab?

    If you run grep in Nokia Qt SDK folder you will find that WA_Maemo5PortraitOrientation is really supported
    Code:
    ~/NokiaQtSDK$ grep -R WA_Maemo5PortraitOrientation *
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4.6 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4.6.2 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so matches
    Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/include/QtCore/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/include/Qt/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Simulator/Qt/gcc/include/QtCore/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Simulator/Qt/gcc/include/Qt/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,

  9. #9
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    Could you please provide a screenshot of Projects Build Settings tab?

    If you run grep in Nokia Qt SDK folder you will find that WA_Maemo5PortraitOrientation is really supported
    Code:
    ~/NokiaQtSDK$ grep -R WA_Maemo5PortraitOrientation *
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4.6 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so.4.6.2 matches
    Binary file Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/lib/libQtCore.so matches
    Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/include/QtCore/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1011-slim/usr/include/Qt/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Simulator/Qt/gcc/include/QtCore/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,
    Simulator/Qt/gcc/include/Qt/qnamespace.h:        WA_Maemo5PortraitOrientation = 128,

  10. #10
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Hmm... I just noticed a strange thing. When I set the the target to Maemo, it seems to build it OK. Of course it won't send it to the device, since it doesn't have PR1.2. But at least it doesn't complain about WA_Maemo5PortraitOrientation. But as soon as I set Qt Simulator as target, it does.

  11. #11
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by Sasler View Post
    Hmm... I just noticed a strange thing. When I set the the target to Maemo, it seems to build it OK. Of course it won't send it to the device, since it doesn't have PR1.2. But at least it doesn't complain about WA_Maemo5PortraitOrientation. But as soon as I set Qt Simulator as target, it does.
    SDKs used for Maemo target and Qt Simulator are different. The latter doesn't have Maemo specific library, so you cannot compile Maemo-specific code there.
    You should be able to run application on the device, if you install Qt 4.6.2 manually on the device
    http://repository.maemo.org/pool/fre...ree/q/qt4-x11/

  12. #12
    Registered User
    Join Date
    Jan 2010
    Posts
    272

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    SDKs used for Maemo target and Qt Simulator are different. The latter doesn't have Maemo specific library, so you cannot compile Maemo-specific code there.
    You should be able to run application on the device, if you install Qt 4.6.2 manually on the device
    http://repository.maemo.org/pool/fre...ree/q/qt4-x11/
    But I was under the impression that Nokia Qt SDK should use only 4.6.2. Is it using 4.5.3 instead?

  13. #13
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by Sasler View Post
    But I was under the impression that Nokia Qt SDK should use only 4.6.2. Is it using 4.5.3 instead?
    Nokia Qt SDK uses only Qt 4.6.2.

  14. #14
    Registered User
    Join Date
    Oct 2009
    Posts
    2

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by divanov View Post
    SDKs used for Maemo target and Qt Simulator are different. The latter doesn't have Maemo specific library, so you cannot compile Maemo-specific code there.
    You should be able to run application on the device, if you install Qt 4.6.2 manually on the device
    http://repository.maemo.org/pool/fre...ree/q/qt4-x11/
    Cant we add those libraries externally to the Qt creator? I have found the libraies in
    qt-maemo5-opensource-src-4.6.2.tar.gz so that we can compile it in the Qt creator and run in the simulator?

    There are some instructions in the unzipped folder but it didn't add it to the Qt creator..
    at least not for me

    I really wanna wait for PR 1.2

  15. #15
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to detect orientation in Qt 4.6.2?

    Quote Originally Posted by hareeshsingireddy View Post
    Cant we add those libraries externally to the Qt creator?

    I have found the libraies in
    qt-maemo5-opensource-src-4.6.2.tar.gz so that we can compile it in the Qt creator and run in the simulator?

    There are some instructions in the unzipped folder but it didn't add it to the Qt creator..
    at least not for me

    I really wanna wait for PR 1.2
    Qt Creator is just an IDE. You need Fremantle Maemo SDK to be choosen in Qt Simulator build settings (Qt Version, see the screenshot). Building Qt from the source makes no sense for several reasons, but the main one Nokia Qt SDK already contains MADDE version with Fremantle Maemo SDK if you choose a Maemo target instead of Qt Simulator.

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. automatic rotate screen on meamo
    By fily_love in forum Nokia N9
    Replies: 27
    Last Post: 2010-04-06, 08:37
  3. gsreamer-0.10-plugins-good+Phonon
    By niqt in forum Nokia N9
    Replies: 10
    Last Post: 2010-03-05, 09:56
  4. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41

Posting Permissions

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