×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Problem with QGeoLocationInfoSource

    Hi,

    I'm trying to write a trivial QT program that uses the location API.

    I'm using QT Creator 1.3.83.

    When I run the program in the simulator, all is OK and I can determine (and display) my location OK.

    However, when I run it on my phone (A Nokia 5800) from QT Creator, I get the following

    Process 1529, thread 1530 stopped at 0x802a12f1: Thread 0x5fa has panicked. Category: Lbs Client Fault; Reason: 6

    This is triggered by the line of code:

    source = QGeoPositionInfoSource::createDefaultSource(parent);

    If anyone can suggest what I'm doing wrong, I'd very much appreciate it.

    Thanks,
    Rob

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Problem with QGeoLocationInfoSource

    Sorry about the thread title - It should of course have read QGeoPositionInfoSource.

  3. #3
    Registered User
    Join Date
    Jul 2006
    Location
    Finland
    Posts
    26

    Re: Problem with QGeoLocationInfoSource

    Hi Rob,

    first of all, don't be surprised if something works on your Windows(?) maschine and then does not work/works differently on your target device. Welcome to cross-platform development ;-).

    Are you sure that the panic really happens here?
    source = QGeoPositionInfoSource::createDefaultSource(parent);
    QGeoPositionInfoSource code looks okey. In fact, QGeoPositionInfoSource::createDefaultSource traps potential leaves of CQGeoPositionInfoSourceS60::NewL. So, I wonder how you can get a panic there ...
    -Rob

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Problem with QGeoLocationInfoSource

    Rob,

    Thanks for the reply. It's definitely this line of code, as I stripped my example back so that this is the *only* line in my example that does anything with the location API.

    The rest of my application just displays "Hello World" on the screen. If I comment out the line of code above, it all runs find on my 5800. If I uncomment it I see the panic.

    I guess it could be happening on another thread, if the createDefaultSource has started such a thread. I'm afraid I'm not clued up enough to know how to tell...

    Here's the code:

    main.cpp:

    #include <QtGui/QApplication>
    #include "loctest.h"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    LocTest w;
    #if defined(Q_WS_S60)
    w.showMaximized();
    #else
    w.show();
    #endif
    return a.exec();
    }


    loctest.h:

    #ifndef LOCTEST_H
    #define LOCTEST_H

    #include <QtGui/QMainWindow>
    #include <QObject>
    #include <QGeoPositionInfoSource>
    #include <QGeoPositionInfo>

    QTM_USE_NAMESPACE

    class LocTest : public QMainWindow
    {
    Q_OBJECT

    public:
    LocTest(QWidget *parent = 0);
    ~LocTest();

    protected:
    void paintEvent(QPaintEvent *event);

    private:
    QGeoPositionInfoSource *source;

    };

    #endif // LOCTEST_H

    loctest.cpp:
    #include <QtGui>
    #include "loctest.h"

    LocTest::LocTest(QWidget *parent)
    : QMainWindow(parent)
    {
    source = QGeoPositionInfoSource::createDefaultSource(parent);
    }

    LocTest::~LocTest()
    {

    }

    void LocTest:aintEvent(QPaintEvent *) {
    QPainter p(this);
    p.setRenderHint(QPainter::Antialiasing);

    QColor w = QColor("red");
    p.fillRect(0,0,200,200,w);

    QString m1;
    QTextStream(&m1) << "Hello World";
    QColor b = QColor("black");
    p.setPen(b);
    p.drawText(8,20, m1);
    }


    I'm not the world's strongest C++ coder (my background's Java), so this could be a trivial error on my part, but if there is, I can't see it.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Problem with QGeoLocationInfoSource

    OK - I've managed to fix it. Here's the solution for anyone else who hits the same issue:

    In my project file I was missing the following:

    symbian {
    TARGET.UID3 = 0xeb20e322
    TARGET.CAPABILITY = Location
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }

    (TARGET.CAPABILITY was commented out). Correcting this lines and doing a clean rebuild left things working.

    Rob - thanks for your help anyhow.

    Rob

  6. #6
    Registered User
    Join Date
    Jul 2006
    Location
    Finland
    Posts
    26

    Re: Problem with QGeoLocationInfoSource

    Hi Rob,

    great that you figured it out!

    Just for your information: Cause I figured that it wasnt you who commented that line, I quickly searched the Qt mobility bug reports. Et voila! This commented line is acutally not bug, its a feature:

    http://bugreports.qt.nokia.com/browse/QTMOBILITY-37

    Quote from the report:
    "Some of the Mobility libraries have a commented out line in their .pro files describing the minimum set of capabilities required by the libraries themselves. This should make things easier for the users that feel the need to modify the libraries themselves."
    -Rob

  7. #7
    Registered User
    Join Date
    Jul 2009
    Posts
    22

    Re: Problem with QGeoLocationInfoSource

    Hi,

    I am experiencing the same error. However both my application and the location library are built with All -tcb capabilities and yet I receive the same error.

    Was there anything else you modified or changed?

    Cheers

Similar Threads

  1. STLPort namespace issue
    By yickhong in forum Open C/C++
    Replies: 0
    Last Post: 2009-04-09, 08:54
  2. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  3. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  4. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  5. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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