Results 1 to 6 of 6

Thread: Find and Send User Current Location like Viber with QT

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2014
    Posts
    9
    Qt products
    Qt5
    Platforms
    MacOS X Android

    Smile Find and Send User Current Location like Viber with QT

    I want to implement an application like viber that can be able to fine user current location and send it on server. I use QT on android.
    here is my code:

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(0);
    if (source){
    qDebug() <<"source->sourceName():" << source->sourceName();
    ui->textEdit->append("sourceName():" + source->sourceName());
    }
    else {
    qDebug() <<"Error:"<< source->error();
    ui->textEdit->append("Error:"+ source->error());
    }
    source->requestUpdate();
    QGeoPositionInfo info = source->lastKnownPosition();
    QGeoCoordinate coordinate = info.coordinate();
    ui->textEdit->append("info.coordinate:"+ coordinate.toString());
    QDateTime timestamp = info.timestamp();
    ui->textEdit->append("info.timestamp():"+ timestamp.toString());
    qDebug() <<"attribute:"<< info.attribute(QGeoPositionInfo::HorizontalAccurac y);

    }

    I finded user current location in "coordinate" variable. now my question is how can i show user current location on a map like viber?
    Last edited by hasti; 23rd September 2014 at 14:47.

Similar Threads

  1. Need to find a way to save user inputs.
    By "BumbleBee" in forum Newbie
    Replies: 23
    Last Post: 4th November 2011, 14:10
  2. Replies: 1
    Last Post: 13th June 2011, 13:06
  3. How to find the location of the user?
    By nikhilqt in forum Qt Programming
    Replies: 7
    Last Post: 14th December 2010, 18:22
  4. Send email without user intervention?
    By variance in forum Newbie
    Replies: 1
    Last Post: 10th June 2010, 14:08
  5. Replies: 2
    Last Post: 27th November 2008, 10:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.