Important: Please read the Qt Code of Conduct -

Best way to draw gps point with qt

  • I dont really know how to ask this question but I will do my best to explain. I have a project on arduino with a gps, I transfere the geo point via serialdata on my pc. I can read it without probleme, but where I need help is how I can draw a path of that point. for the moment I use this:

    void MainWindow::paintEvent(QPaintEvent* p)
        QPainter painter(this); //class must be implemented from QWidget
        painter.translate(width() / 2-466133, height() / 2+727150);
    void MainWindow::readData(QStringList data)
        polyPoints  << QPointF(data[0].toDouble(),data[1].toDouble());

    my point is something like that:

    46.612823, -72.702957
    46.612876, -72.702873
    46.612937, -72.702789

    like you see the difference between 2 point are very very small so I need to scalle this way up and a need to work with rediculous number for translate my origin. for the moment the translate is fixe but in the futur it will be dynamic.

    there an image to show more what I need at the end


    I hope that you understand my problem.

    thank you

  • @Bestrider14

    Take all your data points you have in one set and normalize them to a range that matches your scale.

  • Lifetime Qt Champion

    Or take a proper widget which handles this all for you like ESRI ArcGIS runtime for Qt

  • @Christian-Ehrlicher Ho thanks I will try this widget. It look like is what I need at firt sight.

Log in to reply