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. How to drag a QQuickView Object that is child of other QQuickview Object
Forum Updated to NodeBB v4.3 + New Features

How to drag a QQuickView Object that is child of other QQuickview Object

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 703 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    josancardenasm
    wrote on last edited by
    #1

    Hello, i have written a mini program and i'm trying to drag a QQuickView Object that is child of other QQuickview Object.

    This is my code:

    @
    #include <QApplication>
    #include <QQuickView>
    #include <QUrl>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QQuickView *dash= new QQuickView;
    dash->setSource(QUrl("qrc:/ui1.qml"));
    dash->show();
    
    QQuickView *widget= new QQuickView;
    widget->setParent(dash);
    widget->setSource(QUrl("qrc:/widget.qml"));
    widget->show();
    
    return app.exec&#40;&#41;;
    

    }
    @

    and this is the result

    !https://www.dropbox.com/s/rsho0kyoqvj5ytd/Captura.PNG?dl=0()!

    The qmls files are rectangles only. The green rectangle is the Object that i want to drag, the "widget" Object

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Any reason you want to use QQuickView's ? It would be lot easier if you use one QQuickView to load the QML file and in that QML file you can load components from the other QML files.

      157

      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