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. MapItemView and resizing
Forum Updated to NodeBB v4.3 + New Features

MapItemView and resizing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 137 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.
  • M Offline
    M Offline
    Milly
    wrote on last edited by
    #1

    I am using a MapItemView to render many MapPolyLines on a Map component. The model is a QAbstractModel using C++. The lines show correctly when the Map is first displayed but when the window is resized the model does not refresh unless I pan or zoom the map.

    I initially thought the issue might be to do with my specific setup as I was using a Qt Widgets with a QQuickWidget for my QML. I switched to using a QQuickView but had the same problem. I also tried a pure QML application using QQmlApplicationEngine and get the same result.

    Rather than posting code this issue is reproducible using the GeoJsonViewer example app. If you run the example, load a GeoJson into the viewer and then resize the window so it is larger you should see that the GeoJson isn't redrawn unless you pan or zoom the map (I am using Mac OS Sonoma with Qt 6.7.3).

    I am familiar with several hacks for forcing the MapItemView to redraw the model, but this is very inefficient and my model contains thousands of lines so I would like to find a solution where the model isn't force reloaded.

    Does anyone have any idea how I can achieve this? Even though my model contains thousands of lines, panning the map works silky smooth and I would like something similar for resizing.

    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