Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to merge the code found in the QGeoRoute class (documentation) with the QML MapViewer example?
Forum Updated to NodeBB v4.3 + New Features

How to merge the code found in the QGeoRoute class (documentation) with the QML MapViewer example?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
8 Posts 2 Posters 708 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hass
    wrote on last edited by
    #1

    I have a project where I have to find the shortest route between two points & calculate the ETA depending on the traffic. I found all I needed in the QGeoRoute class, where I found an easy code in the QGeoRoutingManager that I would like to merge with the code in the QML MapViewer found in "Welcome". I'm new to these classes so I would appreciate any help. I don't know if it's even doable.

    1 Reply Last reply
    0
    • Shrinidhi UpadhyayaS Offline
      Shrinidhi UpadhyayaS Offline
      Shrinidhi Upadhyaya
      wrote on last edited by
      #2

      Hi @Hass , actually what you want to achieve using QML MapViewer, as you have told in your project you need to find the shortest route, do you want to display that in QML using MapViwer?

      Shrinidhi Upadhyaya.
      Upvote the answer(s) that helped you to solve the issue.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hass
        wrote on last edited by
        #3

        Hey @Shrinidhi-Upadhyaya , yeah exactly plus I need to show the ETA(estimated time of arrival), I saw other features that I may use too in the QGeoRouteRequest class like Feature Types & Feature weights. I want to use this class in the QML Map Viewer code because of the previously mentioned info that I'd to include.

        1 Reply Last reply
        0
        • Shrinidhi UpadhyayaS Offline
          Shrinidhi UpadhyayaS Offline
          Shrinidhi Upadhyaya
          wrote on last edited by Shrinidhi Upadhyaya
          #4

          Hi @Hass , you can use RouteModel to show the distance between the 2 points and for the ETA you can just calculate it and display the value using Text in QML. I dont actually know what are Feature Weights and Feature Types, and you cant use the QGeoRequest directly in MapViewer i guess,you need to create your own seperate class with the implemented functionalites, and expose that class to QML and use it.

          Shrinidhi Upadhyaya.
          Upvote the answer(s) that helped you to solve the issue.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hass
            wrote on last edited by
            #5

            @Shrinidhi-Upadhyaya Well my question was basically this one, how can I expose that class to QML? In other words, how can I merge them together?I already created my own separate class for the QGeoRoute & QGeoRouteRequest classes.

            1 Reply Last reply
            0
            • Shrinidhi UpadhyayaS Offline
              Shrinidhi UpadhyayaS Offline
              Shrinidhi Upadhyaya
              wrote on last edited by
              #6

              Hi @Hass , you can have a look at this [https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html]

              Shrinidhi Upadhyaya.
              Upvote the answer(s) that helped you to solve the issue.

              1 Reply Last reply
              1
              • H Offline
                H Offline
                Hass
                wrote on last edited by
                #7

                @Shrinidhi-Upadhyaya Great thanks!

                1 Reply Last reply
                0
                • Shrinidhi UpadhyayaS Offline
                  Shrinidhi UpadhyayaS Offline
                  Shrinidhi Upadhyaya
                  wrote on last edited by
                  #8

                  Hi @Hass , can you mark the thread title as [SOLVED]

                  Shrinidhi Upadhyaya.
                  Upvote the answer(s) that helped you to solve the issue.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved