title: Embedding QQuickWidget map inside QWidget not working
body: <p>I have a weird problem regarding embedding the standalone Qt example "mapviewer" inside a QtWidgets desktop app for the sake of displaying a tiled map.
  Standalone it works, e.g. loading a map.
  Embedded inside a QWidget with the recommended way of using QQuickWidget, nothing is working as expected.</p>
  
  <ul>
  <li>When not adding the QQuickWidget <code>view_</code> to the layout, there are 2 (!) top level widgets appearing.</li>
  <li>If i add <code>view_</code> to the layout at the place of the blue question mark, the leftmost widget from the image below gets added to the layout as expected. But still the empty map view stays a top level widget.</li>
  <li>The <code>view_</code>does not load or show anything at all.</li>
  <li>The menus of the <code>view_</code> do not open.</li>
  </ul>
  
  <p>Here is the source:</p>
  
  <pre><code>#include "mapwidget.h"    
  #include &lt;QtQuickWidgets/QQuickWidget&gt;    
  #include &lt;QLabel&gt;
  #include &lt;QVBoxLayout&gt;    
  #include &lt;QQmlApplicationEngine&gt;
  MapWidget::MapWidget(QWidget *parent)
      : QWidget(parent)
  {
      this-&gt;setLayout(new QVBoxLayout);
      this-&gt;layout()-&gt;addWidget(new QLabel("label"));
  
      view_ = new QQuickWidget(nullptr);
      view_-&gt;setWindowTitle("QQuickWidget");
  //    view_-&gt;engine()-&gt;addImportPath(QStringLiteral(":/imports"));
      QUrl url(QStringLiteral("qrc:///mapviewer.qml"));
      view_-&gt;setSource(url);
  
      // Show or embedd the widget, try it out
      view_-&gt;show();
      // this-&gt;layout()-&gt;addWidget(view_);
  
      QFile f(":/mapviewer.qml");
      if ( f.open( QIODevice::ReadOnly )){}
      Q_ASSERT(f.isOpen()); // OKAY so the qml file is found
      f.close();
  }
  </code></pre>
  
  <p>header:</p>
  
  <pre><code>#ifndef MAPWIDGET_H
  #define MAPWIDGET_H
  
  #include &lt;QWidget&gt;
  class QQuickWidget;
  class MapWidget : public QWidget
  {
      Q_OBJECT
      QQuickWidget *view_ = nullptr;
  public:
      explicit MapWidget(QWidget *parent = nullptr);
      ~MapWidget() = default;
  };
  
  #endif // MAPWIDGET_H
  </code></pre>
  
  <p>I have no idea what is so complicated here. I am very familiar with QtWidgets but new to qml, so maybe I lack something quite obvious.</p>
  
  <p><a href="https://i.stack.imgur.com/rqBoT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rqBoT.png" alt="enter image description here"></a></p>