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. Rotating a QWidget containing a QQuickView

Rotating a QWidget containing a QQuickView

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 277 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.
  • A Offline
    A Offline
    agiova
    wrote on last edited by
    #1

    Hi,

    I need to rotate a qml map object but the map is an external plugin-in and doesn't support bearing. So since the map is contained into a QWidget I thought I can be able to rotate the QWidget si that the QQuickView will rotate and with it also the map.

    This is my piece of cose that actually I use to set the QQuickView to the containe QWidget:

        view = new QQuickView();
        view->setResizeMode(QQuickView::SizeRootObjectToView);
        container = QWidget::createWindowContainer(view, this);
        container->setFocusPolicy(Qt::TabFocus);
        view->setSource(QUrl("qrc:/qml/Map.qml"));
        container->setGeometry(10,10,400,400);
    

    I also tried implementing the solution posted here but without any success. The following is the code I tried with the above suggestion:

        view = new QQuickView();
        view->setResizeMode(QQuickView::SizeRootObjectToView);
        container = QWidget::createWindowContainer(view, this);
        container->setFocusPolicy(Qt::TabFocus);
        view->setSource(QUrl("qrc:/qml/Map.qml"));
        container->setGeometry(10,10,400,400);
        rotating = new RotateWidget(this);
        rotating->setBaseWidget(container);
    

    Please cosider that container is a QWidget while view of course QQuickView, while rotating is a RotateWidget class, that is the class implemented in the post linked above.

    I'm using Qt 5.9.1 minGW 32bit on windows.

    What I would like to do is just to rotate the map putting the north-up (the default), south-up, east-up or west-up, but I'm stuck on this.
    Every suggestion will be helpful.

    Thanks in advance!

    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