Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Access QML MapType in c++
Qt 6.11 is out! See what's new in the release blog

Access QML MapType in c++

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • saitejS Offline
    saitejS Offline
    saitej
    wrote on last edited by
    #1

    Hi

    I need to access and store a QML Maptype variable in c++. How do I store this type? I am able to store individual properties of the maptype in lists but is it possible to store as it is with out using user defined types?

    ? 1 Reply Last reply
    0
    • saitejS saitej

      Hi

      I need to access and store a QML Maptype variable in c++. How do I store this type? I am able to store individual properties of the maptype in lists but is it possible to store as it is with out using user defined types?

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @saitej Hi! If I get the docs right there's no C++ API yet:

      Maps and Navigation (C++)
      [...]
      Currently it is not possible to interact with maps via C++. Mapping applications must use the Maps and Navigation (QML) API.

      Looks like you need to make a custom type to store the info.

      saitejS 1 Reply Last reply
      0
      • ? A Former User

        @saitej Hi! If I get the docs right there's no C++ API yet:

        Maps and Navigation (C++)
        [...]
        Currently it is not possible to interact with maps via C++. Mapping applications must use the Maps and Navigation (QML) API.

        Looks like you need to make a custom type to store the info.

        saitejS Offline
        saitejS Offline
        saitej
        wrote on last edited by saitej
        #3

        @Wieland
        They have done it some way on this link .
        The variable m_supportedMapTypes. I think it uses QGeomaptype

        1 Reply Last reply
        0
        • saitejS Offline
          saitejS Offline
          saitej
          wrote on last edited by
          #4

          Also, How do I access the activeMapType for a qml map. I have accessed the map from c++ in the following way.

          QQuickItem *item = widget->rootObject()->findChild<QQuickItem*>("map_main");
          

          and I am trying to set the property of the map like this

          item->setProperty("activeMapType",maptype.name) ;
          

          Is it the right way because I am not able to access the current active maptype also via

           x= item->property("activeMapType.name").toString();
          
          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