Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Multiple models in Map (QtLocation)

    QML and Qt Quick
    qtlocation map model delegate
    2
    4
    1711
    Loading More Posts
    • 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.
    • A
      Alexander_Lanin last edited by

      Hi,

      Map supports model and delegate parameters, but how shall I go about with multiple models?
      e.g. one from c++ for my stuff and one for showing flickr images (as in positioning example, but with lon+lat data).
      Additionally I would like flickr to be optional.

      Shall I merge those two into a single model? In qml or use C++ for flickr too instead of XmlListModel? How would I use different delegates?

      Or draw the data without model/delegate helpers? how?

      Thanks,
      Alex

      1 Reply Last reply Reply Quote 0
      • A
        Alexander_Lanin last edited by

        sorry so stupid... that explains why I found no explanation on how to do this :D

        for reference: model + delegate are not parameters of Map but of MapItemView and one can simply add multiple MapItemViews to one Map.

        Charby 1 Reply Last reply Reply Quote 0
        • Charby
          Charby last edited by

          You can use several models (or even a repeater) as childs of a Map. Making one model tobe optional can be done directly inside a model.
          If you want more details, you could have a look to the workshop materials in this topic : https://forum.qt.io/topic/63838/qt-qml-workshop-materials

          1 Reply Last reply Reply Quote 0
          • Charby
            Charby @Alexander_Lanin last edited by

            @Alexander_Lanin didn't see you already found it before I submit my reply...

            1 Reply Last reply Reply Quote 0
            • First post
              Last post