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. Qt 5.6 MapItemView issue

Qt 5.6 MapItemView issue

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qt5.6mapitemviewmodeldelegate
3 Posts 2 Posters 1.7k Views
  • 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.
  • ginkgoguyG Offline
    ginkgoguyG Offline
    ginkgoguy
    wrote on last edited by
    #1

    Hi,

    last days I try to build my project with Qt 5.6. The most works fine, but I have a problem with the Map component especially with MapItemView. The problem is there is no item shown on the map. Using Qt 5.5 the MapCircle is displayed at the correctly. Simplified my code looks like this snippet.

    import QtQuick 2.5
    import QtLocation 5.5
    import QtPositioning 5.5
    
    
    Map {
        id: map
        zoomLevel: 5
        center {
            latitude: 12
            longitude: 12
        }
        plugin: Plugin {
            name: "osm"
        }
    
        MapItemView {
            model: dummyModel
            delegate: MapCircle {
                center {
                    latitude: model.latitude
                    longitude: model.longitude
                }
                radius: 50000.0
                color: 'green'
                border.width: 3
            }
        }
    
        ListModel {
            id:dummyModel
            ListElement {
                latitude: 12.0
                longitude: 12.0
                Azimuth: 10.0
                Color:"red"
             }
        }
    }
    

    For testing I use qmlscene, but there is the same problem in the project.
    Are there new conditions I don't have considered?

    Best regards

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alexander_Lanin
      wrote on last edited by
      #2

      Hi, I cannot explain this unfortunately and I don't even have Qt 5.6 installed right now.
      With Qt 5.7 this doesn't work with qmlscene either, but it works from QtCreator with a "real" project.
      e.g.:

          import QtQuick 2.5
          import QtLocation 5.5
          import QtPositioning 5.5
          import QtQuick.Controls 1.5
          
          ApplicationWindow
          {
              visible: true
          
              Map {
                  anchors.fill: parent
          
                  id: map
                  zoomLevel: 5
                  center {
                      latitude: 12
                      longitude: 12
                  }
                  plugin: Plugin {
                      name: "osm"
                  }
          
                  MapItemView {
                      model: dummyModel
                      delegate: MapCircle {
                          center {
                              latitude: model.latitude
                              longitude: model.longitude
                          }
                          radius: 50000.0
                          color: 'green'
                          border.width: 3
                      }
                  }
          
                  ListModel {
                      id:dummyModel
                      ListElement {
                          latitude: 12.0
                          longitude: 12.0
                          Azimuth: 10.0
                          Color:"red"
                       }
                  }
              }
          }
      
      1 Reply Last reply
      1
      • ginkgoguyG Offline
        ginkgoguyG Offline
        ginkgoguy
        wrote on last edited by
        #3

        Thanks for your efforts.
        As you said it works in a project I have a second look at my code.
        I'm not writing a Quick-App but a QWidget-App and use the map inside a QQuickWidget. I have read about another approach to embed qml content in a QWidget-App using QQuickView inside a QObject-Container.
        This approach works as expected. I don't know why it doesn't work with a QQuickWidget but my problem is solved.

        Best Regards

        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