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 714 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 11 Mar 2019, 14:53 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
    • S Offline
      S Offline
      Shrinidhi Upadhyaya
      wrote on 12 Mar 2019, 07:55 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 12 Mar 2019, 09:19 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
        • S Offline
          S Offline
          Shrinidhi Upadhyaya
          wrote on 12 Mar 2019, 09:27 last edited by Shrinidhi Upadhyaya 3 Dec 2019, 09:28
          #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 12 Mar 2019, 09:32 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
            • S Offline
              S Offline
              Shrinidhi Upadhyaya
              wrote on 12 Mar 2019, 09:37 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 12 Mar 2019, 09:43 last edited by
                #7

                @Shrinidhi-Upadhyaya Great thanks!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Shrinidhi Upadhyaya
                  wrote on 12 Mar 2019, 09:46 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

                  7/8

                  12 Mar 2019, 09:43

                  • Login

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