×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    16

    Create an array of QGeoPositionInfo elements

    Hi,

    I am developing a special GPS tracking app for which I need to create an array of tagged points (QGeoPositionInfo type). How can I create an array which I can access by the index (of the tag)? I know how to do it for numbers or strings but for QGeoPositionInfo, I have no idea.

    Can you please advise?

    Thank you.

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,086

    Re: Create an array of QGeoPositionInfo elements

    You can probably create array of objects(as QGeoPositionInfo type) & store those objects in a QList. Each QGeoPositionInfo would contain information like coordinates etc or whatever you want to store in a particular object.

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    16

    Re: Create an array of QGeoPositionInfo elements

    Quote Originally Posted by vineet.jain View Post
    You can probably create array of objects(as QGeoPositionInfo type) & store those objects in a QList. Each QGeoPositionInfo would contain information like coordinates etc or whatever you want to store in a particular object.
    Thanks. The problem is I dont know how to create this array.
    Could you please paste a code example? I tried the same way I do with integers and strings but it does not work. Compiler finishes without errors but the app blocks at the point I want to fill the array.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,086

    Re: Create an array of QGeoPositionInfo elements

    probably something like this: http://qt.gitorious.org/qt/qtlocatio...sitioninfo.cpp

    I do not have Qt environment installed on my machine right now, so couldn't try & tell..

  5. #5
    Registered User
    Join Date
    May 2012
    Posts
    16

    Re: Create an array of QGeoPositionInfo elements

    That's a good example but I think it does not fit to my requirement. What I want to do is store complete QGeoPositionInfo data into array. Example: User will tag its position over its route. These positions (tags) should be stored in an array. Later, user can pick one of these tags as a reference point. In the main window, I display the azimuth and distance from current point to this reference point. I only know how to display the azimuth and distanceTo using complete QGeoPositionInfo variable but not its attributes only. Otherwise, I know how to dig out individual attributes such as altitude, coordinates, etc.

    I'm not really skilled programmer so apologies for potentially stupid question.

    Thanks.

Similar Threads

  1. duplicate elements in array
    By Arunesh in forum Mobile Java General
    Replies: 4
    Last Post: 2010-04-29, 08:09
  2. How to initialise elements of an array?
    By dee_viz in forum Symbian
    Replies: 9
    Last Post: 2007-09-20, 19:32
  3. Replies: 8
    Last Post: 2007-07-24, 05:04
  4. Replies: 1
    Last Post: 2007-04-05, 14:56
  5. Replies: 1
    Last Post: 2006-07-05, 18:05

Posting Permissions

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