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. Resizing QQuickWidget window changes positions of inner QML objects on the Map component
Forum Updated to NodeBB v4.3 + New Features

Resizing QQuickWidget window changes positions of inner QML objects on the Map component

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

    Hi everyone!
    I have a problem resizing a QQuickWidget window that contains QML Map and MapQuickItem objects.
    When I resize the window, MapQuickItems that on the Map component change their window position and it turns to normal position only after zooming or dragging the map. How to solve?

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
    }

    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    {
    QQuickWidget *widget = new QQuickWidget;
    widget->setResizeMode(QQuickWidget::ResizeMode::SizeRootObjectToView);
    widget->setSource(QUrl("../map_test/main.qml"));
    setCentralWidget(widget);
    }

    Item {
    width: 1000
    height: 1000
    Map {
    anchors.fill: parent
    plugin: Plugin {
    name: "osm"
    }
    MapQuickItem {
    coordinate: QtPositioning.coordinate(20, 20)
    sourceItem: Rectangle {
    color: "red"
    width: 100
    height: 100
    }
    }
    }
    }

    1 Reply Last reply
    0
    • S Offline
      S Offline
      srce
      wrote on last edited by
      #2

      Did you find a solution to this?

      1 Reply Last reply
      0
      • KaguroK Offline
        KaguroK Offline
        Kaguro
        wrote on last edited by
        #3

        Hi! This is my problrem too any advice? :(

        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