×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    error: 'QSensor' was not declared in this scope

    i've written the same code but i get this result
    error: 'QSensor' was not declared in this scope
    what's wrong?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QSensor compilation problem

    Didn't set the namespace or use the "QtMobility::" prefix?

  3. #3
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QSensor compilation problem

    Quote Originally Posted by mextil View Post
    i've written the same code but i get this result
    error: 'QSensor' was not declared in this scope
    what's wrong?
    Did you try to add to a header file?
    Code:
    using namespace QtMobility;

  4. #4
    Registered User
    Join Date
    Nov 2009
    Posts
    6

    Re: error: 'QSensor' was not declared in this scope

    I've the same problem with QSensor! U.u

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Lightbulb error: 'QSensor' was not declared in this scope

    Solution

    If you want to use QSensor in qt creator. follow these steps.

    1. open project file .prj and add
    CONFIG += mobility
    MOBILITY += sensors

    2. open open header file where you want to include and add
    #include <QSensor> //include this file
    using namespace QtMobility; //add this line after header file declarations

    3. create a object and start using.
    [/INDENT][/CENTER]

  6. #6
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Re: error: 'QSensor' was not declared in this scope

    use the macro QTM_USE_NAMESPACE

    __
    http://svaj.hostei.com/

Similar Threads

  1. string errors using stlport
    By sajjad4joy in forum Open C/C++
    Replies: 3
    Last Post: 2008-11-25, 09:53
  2. Browser monitoring
    By NevePankaj in forum Symbian
    Replies: 19
    Last Post: 2008-08-12, 10:06
  3. C-code..unable to make sis
    By Symbian_Neil in forum Symbian
    Replies: 9
    Last Post: 2006-12-02, 07:55
  4. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11

Posting Permissions

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