no reference to 'QtMobilitySubset::QGeoPositionInfoSource:createDefaultSource(QObject*) '.

/*
 * FenceApproachManager.h
 *
 *  Created on: Mar 7, 2013
 *      Author: noahhuang
 */

#ifndef FENCEAPPROACHMANAGER_H_
#define FENCEAPPROACHMANAGER_H_
#include 
#include 
#include 

using namespace QtMobilitySubset;

class FenceApproachManager: public QObject {
    Q_OBJECT
    public:
        FenceApproachManager();
        virtual ~FenceApproachManager();

    public:
        QGeoPositionInfoSource *m_QGeoPositionInfoSource;

};

#endif /* FENCEAPPROACHMANAGER_H_ */

no reference to 'QtMobilitySubset::QGeoPositionInfoSource:createDefaultSource(QObject*) '.

FenceApproachManager::FenceApproachManager() {
    m_FenceManager = new FenceManager();
    m_FenceManager->syncFenceFromServer();
    //Set up the position info source.

    m_QGeoPositionInfoSource = QGeoPositionInfoSource::createDefaultSource(this);

...

}

SDK: 10.0.10.672

head file is good. but the problem that happened the file c ++...

Anyone have any ideas? Enjoy...

Found the solution... Thank you

in the pro file... Manual adding this lib...

APP_NAME = Drivewyze

CONFIG += qt warn_on cascades10

LIBS += -lQtLocationSubset

include(config.pri)

Tags: BlackBerry Developers

Similar Questions

  • Get the location of the device

    I had my application built with HTML5 for OS7, I build for BB10 and I decided to go with a feel more native and waterfalls. I must admit however, the old WebWorks documentation was much wasier and friendly, you had a small example of using each feature.

    I'm having a problem getting the location of the device, I went through the sample application "Diagnoses of the situation", but it's really complicated (he has 3 classes of objects with a ton of features to get the location).

    I'm just trying to find the location of the device, using cell towers, every two minutes. I want to create and the entire class for this? Also, how to trigger this function of the part of Cascades?

    I'd appreciate any help!

    Hello

    Here's a simplified example of code. These files are from the empty project template by default in the IDE of Momentix (file-> New-> project-> BlackBerry Project-> Application of stunts-> empty project Standard). They have been updated to include cellsite positioning updates every two minutes. The output will simply through cost.

    applicationui.h:

    // Default empty project template
    #ifndef ApplicationUI_HPP_
    #define ApplicationUI_HPP_
    
    #include 
    
    #include 
    
    using ::QtMobilitySubset::QGeoPositionInfo;     // so the SIGNAL()/SLOT() macros can have matching signatures.
    
    namespace bb { namespace cascades { class Application; }}
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class ApplicationUI : public QObject
    {
        Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
        virtual ~ApplicationUI() {}
    
        void startCellSiteUpdates();
    
    public Q_SLOTS:
        void positionUpdated(const QGeoPositionInfo & pos);
        void positionUpdateTimeout();
    
    private:
        QtMobilitySubset::QGeoPositionInfoSource * _source;
    };
    
    #endif /* ApplicationUI_HPP_ */
    

    applicationui.cpp

    // Default empty project template
    #include "applicationui.hpp"
    
    #include 
    
    #include 
    #include 
    #include 
    
    #include 
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
        // Instantiate the default QGeoPositionInfoSource
        _source = QtMobilitySubset::QGeoPositionInfoSource::createDefaultSource(this);
        if ( _source ) {        // connect to the QGeoPositionInfoSource's signals, to get the position info and/or error status
            connect(_source, SIGNAL(positionUpdated(const QGeoPositionInfo &)), this, SLOT(positionUpdated(const QGeoPositionInfo &)));
            connect(_source, SIGNAL(updateTimeout()), this, SLOT(positionUpdateTimeout()));
        }
    }
    
    // call this method to start the position updates
    void ApplicationUI::startCellSiteUpdates()
    {
        if ( !_source ) {
    
            std::cout << "Error getting default position info source" << std::endl;
            return;
        }
    
        // QtLocation allows control over which provider(s) will be queried for position info. NonSatellitePositioningMethods
        // includes wifi and cellsite fix types.
        _source->setPreferredPositioningMethods( QtMobilitySubset::QGeoPositionInfoSource::NonSatellitePositioningMethods );
    
        // On BlackBerry the default QGeoPositionInfoSource allows finer control over the fix type. This extension, and others, take advantage of the Qt property system.
        // Here we are interested only in cellsite fixes.
        _source->setProperty("fixType", "cellsite");
    
        // set the update interval to a couple of minutes.
        _source->setUpdateInterval(120000);
    
        // start the updates, which we expect to receive in ApplicationUI::positionUpdated()
        _source->startUpdates();
    }
    // slot connected to the QGeoPositionInfoSource::positionUpdated() signal
    void ApplicationUI::positionUpdated(const QGeoPositionInfo & pos)
    {
        // print out the position in a convenient format:
        std::cout << pos.coordinate().toString().toLatin1().constData() << std::endl;
    
        // print out the accuracy as well, if available
        if ( pos.hasAttribute(QtMobilitySubset::QGeoPositionInfo::HorizontalAccuracy) ) {
            std::cout << "    horizontal accuracy = " << (double)pos.attribute(QtMobilitySubset::QGeoPositionInfo::HorizontalAccuracy) << std::endl;
        }
    
    }
    // slot connected to the QGeoPositionInfoSource::updateTimeout() signal
    void ApplicationUI::positionUpdateTimeout()
    {
        std::cout << "timeout occurred" << std::endl;
    
        // On BlackBerry more information as to why the device timed out may be available:
        bb::location::PositionErrorCode::Type errorCode = bb::location::PositionErrorCode::None;
    
        if ( _source->property("replyErrorCode").isValid()  ) {
            errorCode = _source->property("replyErrorCode").value();
            if ( errorCode != bb::location::PositionErrorCode::None ) {
                std::cout << "    " << _source->property("replyErrStr").toString().toLatin1().constData() << std::endl;
            }
        }
    }
    

    And main.cpp looks like this:

    // Default empty project template
    #include 
    
    #include 
    #include 
    #include "applicationui.hpp"
    
    // include JS Debugger / CS Profiler enabler
    // this feature is enabled by default in the debug build only
    #include 
    
    using namespace bb::cascades;
    
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        // this is where the server is started etc
        Application app(argc, argv);
    
        // localization support
        QTranslator translator;
        QString locale_string = QLocale().name();
        QString filename = QString( "SimpleLocation_%1" ).arg( locale_string );
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator( &translator );
        }
    
        ApplicationUI * appUI = new ApplicationUI(&app);
    
        appUI->startCellSiteUpdates();
    
        // we complete the transaction started in the app constructor and start the client event loop here
        return Application::exec();
        // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
    }
    

    Your file bar - descriptor.xml must contain this line to allow approval of the app for location-based services:

        access_location_services
    

    Also to ensure that location-based Services are enabled under settings on your device.

    Your .pro file should contain this line so that the QtLocationSubset library is linked:

    LIBS += -lQtLocationSubset
    

    I hope this helps!

    Jim

  • error: 'QGeoPositionInfo' does not designate a type

    Based on https://developer.blackberry.com/cascades/documentation/device_platform/location/index.html, I tried to build the following codes:

    /*
     * GPSinfo.h
     *
     *  Created on: Sep 18, 2012
     *      Author: CNTEXIE
     */
    //  To start receiving position information,
    //  create a default QGeoPositionInfoSource object,
    //  connect its positionUpdated() signal to a slot
    //  on your receiving object, configure the
    //  DefaultGeoPositionSource instance
    //  (setPreferredPositioningMethods(),
    //  setUpdateInterval())
    //  and then invoke startUpdates(). The
    //  slot on your receiving object will be
    //  invoked as close to the desired update
    //  interval as possible, and will be passed
    //  the position information in a GeoPosition instance.
    #ifndef GPSINFO_H_
    #define GPSINFO_H_
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace std;
    
    class GPSinfo: public QObject {
    Q_OBJECT
    public:
        GPSinfo();
        virtual ~GPSinfo();
    private Q_SLOTS:
        void positionUpdated(const QGeoPositionInfo &info);
    };
    
    #endif /* GPSINFO_H_ */
    
    /*
     * GPSinfo.cpp
     *
     *  Created on: Sep 18, 2012
     *      Author: CNTEXIE
     */
    
    #include "GPSinfo.h"
    using namespace bb::cascades;
    
    GPSinfo::GPSinfo(QObject *parent = 0) :
            QObject(parent) {
        QGeoPositionInfoSource *source =
                QGeoPositionInfoSource::createDefaultSource(this);
        if (source) {
            connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)), this,
                    SLOT(positionUpdated(QGeoPositionInfo)));
            source->setPreferredPositioningMethods(
                    PositioningMethod::SatellitePositioningMethods);
            source->setUpdateInterval(1000);
            source->setProperty("backgroundMode", true);
            source->startUpdates();
        }
    }
    void GPSinfo::positionUpdated(const QGeoPositionInfo &info) {
        // Here's where you can do something with the device's position
        qDebug() << "Position updated:" << info;
    }
    
    GPSinfo::~GPSinfo() {
        // TODO Auto-generated destructor stub
    }
    

    The results are:

    .. /SRC/GPSinfo.h:43:29: error: 'QGeoPositionInfo' does not designate a type
    .. /SRC/GPSinfo.h:43:47: error: ISO C++ forbidden 'info' with no type declaration [-fpermissive]
    CC: C:/bbndk/host_10_0_6_1/win32/x86/usr/lib/gcc/i486-pc-nto-qnx8.0.0/4.6.3/cc1plus caught signal 1
    make [2]: leaving directory 'C:/Users/CNTEXIE/ndk-10.0.6-workspace/xGPSmaster/x86 '.
    make [2]: * [o-g/.obj/app.o] error 1
    make [1]: leaving directory 'C:/Users/CNTEXIE/ndk-10.0.6-workspace/xGPSmaster/x86 '.
    make [1]: * [debug] error 2
    make: * [Simulator-Debug] error 2

    Can help?

    Add this line...

    using the QtMobilitySubset namespace;

    and have this added to your .pro file
    LIBS +=-lQtLocationSubset

  • Problems with GPS signal/slot

    Hello

    I try to get GPS information for my application. I did a class to do so.

    #ifndef GPSHANDLER_H_
    #define GPSHANDLER_H_
    
    #include 
    
    #include 
    
    #include 
    #include 
    #include 
    
    using namespace QtMobilitySubset;
    
    class GPShandler : public QObject{
        Q_OBJECT
    public:
        GPShandler(QObject* parent);
        virtual ~GPShandler();
    private Q_SLOTS:
        void positionUpdatedSlot(const QGeoPositionInfo &geoInfo);
    
    public:
        void start();
    
        void stop();
    
        double Latitude();
    
        double Longitude();
    
    private:
        double mGeoInfoLat;
        double mGeoInfoLong;
        QGeoPositionInfoSource *mGeo;
    };
    #endif /* GPSHANDLER_H_ */
    
    #include "GPShandler.h"
    
    GPShandler::GPShandler(QObject* parent)
    : QObject(parent) {
        mGeoInfoLat = 0;
        mGeoInfoLong = 0;
        mGeo = QGeoPositionInfoSource::createDefaultSource(this);
        if (mGeo) {
            bool checkval = connect(mGeo, SIGNAL(positionUpdated(const QGeoPositionInfo &)), this,
                    SLOT(positionUpdatedSlot(const QGeoPositionInfo &)));
    
            mGeo->setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
            mGeo->setUpdateInterval(1000);
    
            //checkval = mGeo->setProperty("backgroundMode", true);
            //int i = 3;
        }
    }
    
    GPShandler::~GPShandler() {
        // TODO Auto-generated destructor stub
    }
    
    void GPShandler::positionUpdatedSlot(const QGeoPositionInfo &geoInfo) {
        // Here's where you can do something with the device's position
        mGeoInfoLat = geoInfo.coordinate().latitude();
        mGeoInfoLong = geoInfo.coordinate().longitude();
    }
    
    void GPShandler::start()
    {
        mGeo->startUpdates();
    }
    
    void GPShandler::stop()
    {
        mGeo->stopUpdates();
    }
    
    double GPShandler::Latitude()
    {
        return mGeoInfoLat;
    }
    
    double GPShandler::Longitude()
    {
        return mGeoInfoLong;
    }
    

    As you can see I have connected the signal postionUpdate() of QGeo class that I use for the positionUpdatedSlot() of the slot. I use the class as follows:

    Pop = new GPShandler (this);

    void::startTimer() {} App

    Pop-> start();

    }
    void::stopTimer() {} App

    Pop-> stop();

    }

    which are called when a key is pressed. However, the positionUpdatedSlot() of slot function is never called. I have debugged in my code and cannot find the problem. I can confirm the work of connection (function returns true), and that presented startup and shutdown functions are called as expected. Is there a reason why my slot machine function is not called?

    Note: I have another implementation of signal/slot in this app:

    Connect (mTimer, SIGNAL (timeout ()), this, SLOT (update ()));

    and it works very well.

    Thank you

    Gerry

    I do not know which of the following has solved my problem, but in any case, it's working now after doing these things:

    1. give permission to app to device identification information. (I had already given GPS, but examples also being device identifying information I thought I'd try that)

    2. remove the line:

           mGeo>setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
    

    as an example, I created using this example: http://blackberry.github.com/Cascades-Samples/geo-locationdiagnostics.html did not have this line

  • Facing problem to collect the geo location

    Hello

    I'm trying to collect the geo location using QGeopositionInfoSource, but I get an error message "LocationManagerUtil.cpp:sendRequest(): error opening pps object, errno = 13 (permission denied)." Customers should check they have permission to access_location_services. " . The code I used is shown below

    QGeoPositionInfoSource* geoPositionSource =  QGeoPositionInfoSource::createDefaultSource(this);
        geoPositionSource->setPreferredPositioningMethods(QtMobilitySubset::QGeoPositionInfoSource::AllPositioningMethods);
        if(geoPositionSource)
        {
    
            connect(geoPositionSource,SIGNAL(positionUpdated(QGeoPositionInfo)),this,SLOT(positionUpdated(QGeoPositionInfo)));
            geoPositionSource->requestUpdate();
    
        }
    

    Thank you

    Dembélé George Jacob

    Sorry to all,

    I forgot to add the authorization in the bar-descripter file.

    Thank you

  • positionUpdated (const QGeoPositionInfo &amp; info) never invoked

    Based on https://developer.blackberry.com/cascades/documentation/device_platform/location/index.html, I fixed several errors and finished work. However, positionUpdated (const QGeoPositionInfo & info) is never called. Someone at - he successfully got positionUpdated()? You can share your codes?

    Here's the part of my codes:

    GPSinfo::GPSinfo(QObject *parent = 0) :   QObject(parent){
        source = QGeoPositionInfoSource::createDefaultSource(this);
        if (source) {
            bool res =connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)), this,
                    SLOT(positionUpdated(QGeoPositionInfo)));
            Q_ASSERT(res);
            Q_UNUSED(res);
            source->setPreferredPositioningMethods(
            QGeoPositionInfoSource::SatellitePositioningMethods);
            source->setUpdateInterval(1000);
            source->setProperty("backgroundMode", true);
                      source->startUpdates();
        }
    }
    

    By setting the positioning preferred SatellitePositioningMethods methods, you should ideally an unobstructed view of the sky to get an update of position. Have you tried AllPositioningMethods? If you have a wifi connection, you should get an update of position a few seconds and you can confirm if all goes well that your housing is called.

    Kind regards

    Jim

  • qmlRegisterType problem

    I cannot register a QML type. The first time I did it with the DataModel PrayerModel type I managed to do the work. However, I get errors with the PrayerBBMManager now. It is based on the example of Battambang, but I simplified the entire BBM feature heavily.

    Real errors are:

    Description Resource    Path    Location    Type
    undefined reference to `prayerbbm::PrayerBBMManager::~PrayerBBMManager()'   PrayerJournal       line 86, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarativeprivate.h    C/C++ Problem
    
    Description Resource    Path    Location    Type
    undefined reference to `prayerbbm::PrayerBBMManager::PrayerBBMManager(QObject*)'    PrayerJournal       line 82, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarativeprivate.h    C/C++ Problem
    
    Description Resource    Path    Location    Type
    undefined reference to `prayerbbm::PrayerBBMManager::staticMetaObject'  PrayerJournal       line 163, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h  C/C++ Problem
    
    Description Resource    Path    Location    Type
    undefined reference to `prayerbbm::PrayerBBMManager::staticMetaObject'  PrayerJournal       line 189, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h  C/C++ Problem
    

    Here's my PrayerJournal.cpp file:

    #include "PrayerJournal.h"
    #include "prayermodel.h"
    #include "prayerbbm/prayerbbmmanager.h"
    
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace prayerbbm;
    
    PrayerJournal::PrayerJournal(bb::cascades::Application *app)
    : QObject(app)
    {
        qDebug() << "starting PrayerJournal app constructor ";
        QCoreApplication::setOrganizationName("Alliteration Applications");
        QCoreApplication::setOrganizationDomain("http://alliterationapplications.com");
        QCoreApplication::setApplicationName("Prayer Journal");
    
      qmlRegisterType("com.prayerjournal.prayerdata", 1, 0, "PrayerModel");
      qmlRegisterType("com.prayerjournal.prayerbbm", 1, 0, "PrayerBBMManager");
      qDebug() << "Registered PrayerModel and PrayerBBM types for QML";
    
      // Create a QMLDocument and load it, using build patterns.
      QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
      if (!qml->hasErrors()) {
          qDebug() << "QML is error-free! Celebrate!";
      }
      if (qml->hasErrors()) {
          qDebug() << "QML has errors";
      }
    
      //qml->setContextProperty("registrationHandler", registrationHandler);
      AbstractPane *appPage = qml->createRootObject();
      Application::instance()->setScene(appPage);
    
      qDebug() << "Created and initialized main.qml";
    }
    

    Thanks to all that refers to BBM files qml commenting regularly and working backward in this file I can identify the problem happening to qmlRegisterType statement.

    Here's the prayerbbmmanager.h:

    namespace prayerbbm
    {
        /**
         * PrayerBBMManager Description:
         *
         * This manager takes care of registering the application with BBM
         */
        class PrayerBBMManager: public QObject
        {
        Q_OBJECT
    
        public:
            PrayerBBMManager(QObject *parent = 0);
    
            virtual ~PrayerBBMManager();
    

    And the prayerbbmmanager.cpp:

    namespace prayerbbm
    {
        PrayerBBMManager::PrayerBBMManager(QObject *parent) :
                QObject(parent)
        {
             m_uuid = QString::fromUtf8("d8484b8d-bed5-4cde-8c11-462c6a04bc35");
    
             if (mSettings.value("connectToBBM").isNull()) {
                mSettings.setValue("connectToBBM", QVariant(false));
             }
        }
    
        PrayerBBMManager::~PrayerBBMManager()
        {
        }
    

    Any help would be appreciated.

    Yes it could be

    My money is also on the sources of PrayerBBMManager is not THAT MOC would be because they were transferred in a directory that is not referenced in the .pro project file

  • Extending from QObject results in reference not set error vtable

    I have an existing type bean class with QString members bool and a QStringList.

    I want to access its properties of QML I want to use QObject.

    The class compiles very well without the extension of QObject, but when I add it I get "undefined reference to 'vtable for X.

    If this class is compiled:

    /*
     * X.hpp
     *
     *  Created on: 08.11.2012
     *      Author: sha
     */
    
    #ifndef X_HPP_
    #define X_HPP_
    
    #include 
    #include 
    
    class X {
    private:
        QString name;
    public:
        X();
        QString getName() const;
        void setName(QString name);
    };
    
    #endif /* X_HPP_ */
    

    And it does not work:

    /*
     * X.hpp
     *
     *  Created on: 08.11.2012
     *      Author: sha
     */
    
    #ifndef X_HPP_
    #define X_HPP_
    
    #include 
    #include 
    
    class X: public QObject {
    Q_OBJECT
    
    private:
        QString name;
    public:
        X();
        QString getName() const;
        void setName(QString name);
    };
    
    #endif /* X_HPP_ */
    

    No idea why?

    I build for BB10 using NDK 10.0.9.386 and I found moc.exe in C:\bbndk\host_10_0_9_52\win32\x86\usr\bin

    I executed as described in the linked thread, it created a moc_x.cpp and it compiles now.

    However, it seems that for this problem he had incorrect header members in the pro file.
    For some reason any this has not changed Momentics in any way, until I added QObject in one of the files.

  • Builders of the undefined reference and pointer...

    OK, so I tried to make this work...

    MyClass *example=new Myclass();
    

    but it's not working, I don't know what to change...

    Let's see an example:

    newClass.h

    #ifndef NEWCLASS_H_
    #define NEWCLASS_H_
    
    class newClass {
    public:
        newClass();
        virtual ~newClass();
    };
    
    #endif /* NEWCLASS_H_ */
    

    newClass.cpp

    #include "newClass.h"
    
    newClass::newClass() {
        // TODO Auto-generated constructor stub
    
    }
    
    newClass::~newClass() {
        // TODO Auto-generated destructor stub
    }
    

    applicationui.cpp

    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    #include 
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app)
    {
        // prepare the localization
        m_pTranslator = new QTranslator(this);
        m_pLocaleHandler = new LocaleHandler(this);
        if(!QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()))) {
            // This is an abnormal situation! Something went wrong!
            // Add own code to recover here
            qWarning() << "Recovering from a failed connect()";
        }
        // initial load
        onSystemLanguageChanged();
    newClass *temp=new newClass();
    
    }
    
    void ApplicationUI::onSystemLanguageChanged()
    {
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        // Initiate, load and install the application translation files.
        QString locale_string = QLocale().name();
        QString file_name = QString("FirstAppAlone_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
        }
    }
    

    error:

    C:\Users\imnotgoingtotellyoumyuser\ndk-10.2-workspace\FirstAppA\x86/../src/applicationui.cpp:93: undefined reference to `newClass::newClass()'
    

    When files are added to the project, IDE adds them to the .pro or .pri file.

    But this is not enough. Qmake must be launched to regenerate the Makefile file that is used for compiling. It seems that this step was not built in IDE, so clean & reconstruction is necessary.

    I will test it and submit a JIRA ticket if this is the case.

    UPD: confirmed. https://www.BlackBerry.com/jira/browse/tool-2393

  • Necessary to remove the container referenced by QObject subclass?

    MyClass creates and maintains a reference to a container, it creates:

    m_container = new Container();
    

    At some point, the container is added to a page and set as root.

    Later in the application, I want to delete the Page and MyClass.

    I need to remove the container in the destructor of MyClass or the Page doesn't do that automatically?

    This only applies to functions which do it explicitly. They usually have something like this in docs:

    void setContent (bb::cascades::Control *content)
    
    Set the content of the Page.
    
    Ownership will always be transferred to the Page.
    

    internally, he did something like this:

    void setContent(...)
    {
      content->setParent(this);
      ...
    }
    

    So I can delete m_container even if it is owned by the Page?  I do this in a test application, and it hangs when I remove it.

    Seems that I misinformed you once again.

    If the class is designed for this (for example subscribed QObject destroyed() signal and resets it's internal references to the object) it works.  I tried with TabbedPane and the middle tab page just disappeared:

       Tab *t;
        tabbedPane_ = TabbedPane::create()
                .showTabsOnActionBar(true)
                .add(Tab::create() [skipped]
                .add(t = Tab::create() [skipped]
                .add(Tab::create() [skipped]
                ;
        delete t;
    

    Deleting the object must reset the parent, but not the references to the object it seems, it is preferable to delete explicitly before deletion.

    p. s.

    Technically, any QObject-derived class can be one parent to other classes derived from QObject.

    You can explicitly set the parenting:

    obj1-> SetParent (anyOtherQObject)

    p.s.s.

    Can you please send the test code? I'll watch if the crash might be caused by other problems.

  • undefined reference to bb::cascades:multimedia: Camera

    Hello

    IAM trying to use the camera, but even with this simple example, I get the "undefined" reference

    I hope someone can point me in the right dirrection.

    copy of the error:

    undefined reference to ' bb::cascades:multimedia: Camera: Camera(bb::cascades::Container*).

    App.Pro

    LIBS += -lcamapi -lscreen
    

    App.HPP

    #ifndef APP_HPP_
    #define APP_HPP_
    
    #include 
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::cascades::multimedia;
    
    class App: public QObject {
    Q_OBJECT
    public:
        App(bb::cascades::Application *app);
        virtual ~App() {
        }
    
    private:
        Camera *mCamera;
    };
    
    #endif /* APP */
    

    App.cpp

    #include "app.hpp"
    
    App::App(bb::cascades::Application *app) :
            QObject(app) {
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        AbstractPane *root = qml->createRootObject();
    
        mCamera = new Camera();
    
        app->setScene(root);
    }
    

    Hello! You must add - lbbcascadesmultimedia to the .pro file

  • Compiler - undefined reference to QMYSQLDriver error

    Hi all

    I'm writing C++ connection code to a remote database in a BB10 application using a third party library C++ de MySQL. However trying to create an object of QMYSQLDriver (QMYSQLDriver * driver = new QMYSQLDriver()) I get an error "undefined reference to"QMYSQLDriver::QMYSQLDriver(QObject*) '" I'm including and my .pro file looks like this:

    QT += sql
    CONFIG += qt warn_on cascades10
    INCLUDEPATH += /Users/crrd/mysql-connector-c-6.1.1-winx64/mysql-connector-c-6.1.1-winx64/include
    LIBS+= -L/Users/crrd/mysql-connector-c-6.1.1-winx64/mysql-connector-c-6.1.1-winx64/lib/mysqlclient.lib -L/Users/crrd/mysql-connector-c-6.1.1-winx64/mysql-connector-c-6.1.1-winx64/lib/libmysql.lib
    

    I think it's just a problem of the linker, but I don't know exactly what needs to be linked or included. Concerning the documents I found are not (enough for me) clear on that. I also found similar problems on other forums messages, but the responses were not helpful. Any ideas would be appreciated.

    Thank you

    OK, we get there one step at a time. So you have got a copy of interfaces for MYSQL from this site http://www.mysql.com/products/connector in the form of a 'mysql.h' header file to resolve compile time references and, likely, a library (.so or .a static shared object) to resolve external references time of the link to the.

    I do not see a build pre-made for a version of BlackBerry 10 of this library, so I think that you have taken the version generic Linux and creeated a version of this library yourself using a library of 10 BlackBerry in the NDK project?  You can check that you have built a dynamic or static libraries (libFoo.so or libFoo.a) successsfuly?

  • What the property QGeoPositionInfoSource to reset and reset valid types are doing?

    Hello

    I found a property Reset inQGeoPositionInfoSource and Valid reset types are "cold", "warm", "hot", "factory", "ee_data", "almanac", "ephemeris" ????
    But unable to found what is the purpose of this property and what are these valid Types do???

    Reference: http://developer.blackberry.com/cascades/reference/qtmobilitysubset__qgeopositioninfosource.html

    Can someone help me with this?
    Fadi

    Hi Fadi,

    The reset property to reset the GPS receiver on the phone. Valid types involve degrees of reset State. Over time, GPS receivers collect and store data that can be used to help either place resolves quickly and accurately. However unlikely, is that a GPS receiver can get into a bad state, it may still be necessary that it should be reset. What each type of reset means may depend on the GPS receiver (it can vary between phone models). Some things can be qualitatively derived type name and knowledge of GPS terminology.

    Be aware that if you set the reset of the receiver is not actually reset until a post is requested later (i.e. by calling QGeoPositionInfoSource::startUpdates() or QGeoPositionInfoSource::requestUpdate ()). Also, the reset may cause a significant delay until the next update of position occurs.

    Kind regards

    Jim

  • Impossible to include the static library containing the QObject class in Cascades project

    I'm working on the new platform BB10 based on Qt.

    I have a static library project that defines a QObject class (essentially the class sends signals and a few locations). The project compiles fine and gives me a file libwhathever.a nice

    When I try to include this library in my project of stunts I get these errors during construction:

    • undefined references to com::vasco:digipass:sdk:utils:qrcodescanner:MyClass:staticMetaObject
    • undefined reference to com::vasco:digipass:sdk:utils:qrcodescanner:MyClass:newQRCodeDetected (QString)
    • location reference external com::vasco:digipass:sdk:utils:qrcodescanner:MyClass:staticMetaObject undefined: c:\Developer\bbndk\target_10_1_0_2342\qnx6\usr\include\qt4\QtCore\qobject.h
    • location reference external com::vasco:digipass:sdk:utils:qrcodescanner:MyClass:staticMetaObject undefined: c:\Developer\bbndk\target_10_1_0_2342\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h
    • location reference external com::vasco:digipass:sdk:utils:qrcodescanner:MyClass:staticMetaObject undefined: c:\Developer\bbndk\target_10_1_0_2342\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h
    • no reference to vtable for com::vasco:digipass:sdk:utils:qrcodescanner:MyClass
    • no reference to vtable for com::vasco:digipass:sdk:utils:qrcodescanner:MyClass

    I think that I miss the compilation step where the Q_OBJECT macro is run. I'm on the right track? I've heard talk about moc and qmake, but I don't know how or when to use in my build process.

    In fact, I solved my problem simply by running the moc on the header file defining the Q_OBJECT. It generated the file moc, that I needed. Then my ant script does the rest of the compilation with qcc and my indefinite references have disappeared.

  • undefined reference to the own class constructor

    I have some material in my project subfolders and use include it with the full path to add:

    #include 
    

    It compiles fine, but when I try to create the object I get this error:

    undefined reference to `DataServiceConfig::DataServiceConfig(QObject*)'
    

    what I am doing wrong?

    Usually, this happens when you have this in your include file:

    class MyClass

    {

    public:

    MyClass(MyThing*);

    private:

    MyThing * m_thing;

    };

    but this isn't in your MyClass.cpp:

    MyClass::MyClass (MyThing * thing):

    m_thing (Thing)

    {

    }

    In other words, you have the statement - so things that use your class compile - but you do not have the implementation, the linker complains that it can't find it.

    Stuart

Maybe you are looking for