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. [Closed] Qt Platform Specific Location support
Qt 6.11 is out! See what's new in the release blog

[Closed] Qt Platform Specific Location support

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 1.4k 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.
  • Q Offline
    Q Offline
    qt_beginner
    wrote on last edited by
    #1

    Hi Qt-Experts,

    I am a newbie in QT development. I am trying to introduce new position info source class which is a derived class of the QGeoPositionInfoSource. This derived class would be making communication with the GPS device through a customer GPS software. I am having a difficult time in compiling this sample class to do this activity. I keep getting below error when I compile the code

    c_qgeopositioninfosource_linux_p.o ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:48: error: âQGeoPositionInfoSourceLinuxâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:49: error: âQGeoPositionInfoSourceâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:57: error: âQGeoPositionInfoSourceLinuxâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:57: error: non-member function âconst QMetaObject* metaObject()â cannot have cv-qualifier
    /usr/include/qt4/QtCore/qobject.h: In function âconst QMetaObject* metaObject()â:
    /usr/include/qt4/QtCore/qobject.h:296: error: âQScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > QObject::d_ptrâ is protected
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:59: error: within this context
    /usr/include/qt4/QtCore/qobject.h:296: error: invalid use of non-static data member âQObject::d_ptrâ
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:59: error: from this location
    /usr/include/qt4/QtCore/qobject.h:296: error: âQScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > QObject::d_ptrâ is protected
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:59: error: within this context
    /usr/include/qt4/QtCore/qobject.h:296: error: invalid use of non-static data member âQObject::d_ptrâ
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:59: error: from this location
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp: At global scope:
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:62: error: âQGeoPositionInfoSourceLinuxâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp: In function âvoid* qt_metacast(const char*)â:
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: expected type-specifier before âQGeoPositionInfoSourceLinuxâ
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: expected â>â before âQGeoPositionInfoSourceLinuxâ
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: expected â(â before âQGeoPositionInfoSourceLinuxâ
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: âQGeoPositionInfoSourceLinuxâ was not declared in this scope
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: expected primary-expression before â>â token
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: invalid use of âthisâ in non-member function
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:66: error: expected â)â before â;â token
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:67: error: âQGeoPositionInfoSourceâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp: At global scope:
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:70: error: âQGeoPositionInfoSourceLinuxâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp: In function âint qt_metacall(QMetaObject::Call, int, void**)â:
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:72: error: âQGeoPositionInfoSourceâ has not been declared
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:77: error: âstartUpdatesâ was not declared in this scope
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:78: error: âstopUpdatesâ was not declared in this scope
    ../../build/Debug/QtLocation/moc/moc_qgeopositioninfosource_linux_p.cpp:79: error: ârequestUpdateâ was not declared in this scope

    My qgeopositioninfosource_linux_p.h is as below:

    #ifndef QGEOPOSITIONINFOSOURCELINUX_H
    #define QGEOPOSITIONINFOSOURCELINUX_H
    #include "qgeopositioninfosource.h"

    QTM_BEGIN_NAMESPACE

    class QGeoPositionInfoSourceLinux : public QGeoPositionInfoSource
    {
    Q_OBJECT

    public:
    QGeoPositionInfoSourceLinux(QObject *parent = 0);
    virtual QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
    virtual PositioningMethods supportedPositioningMethods() const;
    virtual int minimumUpdateInterval() const;
    public Q_SLOTS:
    void startUpdates();
    void stopUpdates();
    void requestUpdate(int timeout = 5000);
    };

    QTM_END_NAMESPACE

    #endif

    I am just unable to resolve this error that is reported when compiling the moc file. Any help from QT experts to resolve this error is highly appreciated.

    BR,
    -Raghu

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Closed. Don't post "duplicates":/forums/viewthread/20589/ please.

      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