Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Mobility in QtSDK
Forum Updated to NodeBB v4.3 + New Features

Qt Mobility in QtSDK

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 3 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gronerth
    wrote on last edited by
    #1

    Hello everyone,

    I am trying to play with the APIs of QtMobility, but i am having compiling errors. I am including the following headers:

    @
    #include <qmessageservice>
    #include <qmessage>
    #include <qmessageaddress>
    #include <qmessageManager>
    @

    Then, i am adding the macro QTM_USE_NAMESPACE, then in the main code i am doing something like this:

    @
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QMessageService* serviceAction = new QMessageServiceAction();
    

    @

    But i am having the following errors:

    C:\Users\JTorres\Documents\QtProjects\QML\QtMobilityExamples\main.cpp:14: error: expected type-specifier before 'QMessageServiceAction'
    C:\Users\JTorres\Documents\QtProjects\QML\QtMobilityExamples\main.cpp:14: error: cannot convert 'int*' to 'QtMobility::QMessageService*' in initialization
    C:\Users\JTorres\Documents\QtProjects\QML\QtMobilityExamples\main.cpp:14: error: expected ',' or ';' before 'QMessageServiceAction'

    In the .pro file i am adding "mobility":

    @
    CONFIG += mobility
    MOBILITY += messaging
    @

    Anyone knows what i am doing wrong?, it is like the compiler is not finding the right headers.

    Thanks in advance!


    JETG

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      What target are you building for (Simulator, Desktop, etc.)?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gronerth
        wrote on last edited by
        #3

        [quote author="loladiro" date="1309473181"]What target are you building for (Simulator, Desktop, etc.)?[/quote]

        Symbian^3


        JETG

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chuck Gao
          wrote on last edited by
          #4

          How about the code in Line 14 ?

          Chuck

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gronerth
            wrote on last edited by
            #5

            [quote author="Chuck.Gao" date="1309483595"]How about the code in Line 14 ?[/quote]

            This is the complete code in main that i wrote just for testing:

            @
            #include <QtGui/QApplication>
            #include <qmessageservice>
            #include <qmessage>
            #include <qmessageaddress>
            #include <qmessageManager>
            #include "qmlapplicationviewer.h"

            QTM_USE_NAMESPACE

            int main(int argc, char *argv[])
            {
            QApplication app(argc, argv);

            QMessageService* serviceAction = new QMessageServiceAction();
            
            QmlApplicationViewer viewer;
            viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
            viewer.setMainQmlFile&#40;QLatin1String("qml/QtMobilityExamples/main.qml"&#41;);
            viewer.showExpanded();
            
            return app.exec();
            
            delete serviceAction;
            

            }
            @


            JETG

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chuck Gao
              wrote on last edited by
              #6

              I'm sorry, but what's the QMessageServiceAction ? It seems that's the problem.

              Chuck

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Chuck Gao
                wrote on last edited by
                #7

                I can't find the Class introduction in Qt document. So, where you find the code ?

                Chuck

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  gronerth
                  wrote on last edited by
                  #8

                  [quote author="Chuck.Gao" date="1309485224"]I'm sorry, but what's the QMessageServiceAction ? It seems that's the problem.[/quote]

                  You`re absolutely right!!!!, i was changing the code "QMessageServiceAction" to "QMessageService", but i couldn't see that i forgot to change one of them, so sorry, my misstake...

                  [quote author="Chuck.Gao" date="1309485283"]I can't find the Class introduction in Qt document. So, where you find the code ?[/quote]

                  I have found it in a book called "Qt for Symbian", maybe in Qt Mobility 1.0 that class exists....

                  By the way, is it normal that the headers appear "underlined" like if it doesn't exist:

                  !http://img269.imageshack.us/img269/7177/headersnw.png!


                  JETG

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Chuck Gao
                    wrote on last edited by
                    #9

                    I think them should be
                    @
                    #include <qmessageservice.h>
                    #include <qmessage.h>
                    #include <qmessageaddress.h>
                    #include <qmessageManager.h>
                    @

                    Chuck

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      loladiro
                      wrote on last edited by
                      #10

                      [quote author="Chuck.Gao" date="1309487447"]I think them should be
                      @
                      #include <qmessageservice.h>
                      #include <qmessage.h>
                      #include <qmessageaddress.h>
                      #include <qmessageManager.h>
                      @[/quote]

                      either that or
                      @
                      #include <QMessageService>
                      #include <QMessage>
                      #include <QMessageAddress>
                      #include <QMessageManager>
                      @
                      Also as long as the compiler doesn't give you a header not found warning, it may be ok that it's underlined in Qt Creator (the include path is set through qmake and I don't know if Qt Creator parses that properly-there are two different parser implementation and qmake's is larger).

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        gronerth
                        wrote on last edited by
                        #11

                        Chunk.Gao is the same behaviour:

                        !http://img829.imageshack.us/img829/2765/headers2.png(headers)!

                        [quote author="loladiro" date="1309515767"]either that or
                        @
                        #include <QMessageService>
                        #include <QMessage>
                        #include <QMessageAddress>
                        #include <QMessageManager>
                        @
                        Also as long as the compiler doesn't give you a header not found warning, it may be ok that it's underlined in Qt Creator (the include path is set through qmake and I don't know if Qt Creator parses that properly-there are two different parser implementation and qmake's is larger).
                        [/quote]

                        It still underline in Qt Creator:

                        !http://img84.imageshack.us/img84/571/headers3.png!

                        The compiler doesn't give me any warning about those headers, i mean it compiles fine...but the Qt Classes that are inside that headers, won't be highlighted in the code editor and i can't use the autocompletion method because the Qt Creator parser doesn't find those headers...


                        JETG

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved