<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    I have a project without widgets. Opening a QQuickView as a modal
    dialog works fine on Windows.<br>
    On Android, though, the QQuickView is hidden behind the main window
    (which is of QML type "ApplicationWindow").<br>
    I've tried <br>
    <span style=" color:#800080;">    @new QQuickView</span><span
      style=" color:#000000;">(</span><span style=" color:#000000;">)@</span><br>
    <span style=" color:#000000;">as well as <br>
    </span><span style=" color:#800080;">    @new QQuickView</span><span
      style=" color:#000000;">(</span><span style=" color:#008000;">controller->engine(),</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#008000;"><span
        style=" color:#000000;"></span><span style=" color:#008000;">controller</span>->topLevelWindow()</span><span
      style=" color:#000000;">)@<br>
    </span>(topLevelWindow() returns a QQuickWindow, engine() returns a
    <span style=" color:#000000;">QQmlApplicationEngine)<br>
      <br>
      I've also played around with WindowFlags - to no avail.<br>
      <br>
      Any idea on how to bring the QuickView to the front?<br>
-------------------------------------------------------------------------------<br>
      More info:<br>
      <br>
      With swapping active Apps around on my phone I can bring the
      dialog to the front, but I have not succeeded to do that
      programmatically.<br>
      This is how I open the Dialog:<br>
      <br>
    </span><span style=" color:#808000;">@void</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#800080;">AbstractApp</span><span
      style=" color:#000000;">::</span><span style=" font-style:italic;
      color:#000000;">openIncEditView</span><span style="
      color:#000000;">(</span><span style=" color:#800080;">QString</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">title</span><span
      style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span
      style=" color:#800080;">QString</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#000000;">interfaceName</span><span
      style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span
      style=" color:#800080;">QVariant</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#000000;">interfaceVariant</span><span
      style=" color:#000000;">)</span>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">{
</span><span style=" color:#800000;">    m_incEditView</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">MyQQuickView</span><span style=" color:#000000;">();</span>
</pre>
    <span style=" color:#c0c0c0;">        </span><span style="
      color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span
      style=" color:#000000;">setResizeMode</span><span style="
      color:#000000;">(</span><span style=" color:#800080;">QQuickView</span><span
      style=" color:#000000;">::</span><span style=" color:#800080;">SizeRootObjectToView</span><span
      style=" color:#000000;">);</span>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setWidth</span><span style=" color:#000000;">(</span><span style=" color:#000080;">500</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setHeight</span><span style=" color:#000000;">(</span><span style=" color:#000080;">200</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setModality</span><span style=" color:#000000;">(</span><span style=" color:#800080;">Qt</span><span style=" color:#000000;">::</span><span style=" color:#800080;">ApplicationModal</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setFlags</span><span style=" color:#000000;">(</span><span style=" color:#800080;">Qt</span><span style=" color:#000000;">::</span><span style=" color:#800080;">Dialog</span><span style=" color:#000000;">);</span></pre>
    <span style=" color:#c0c0c0;">        </span><span style="
      color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span
      style=" color:#000000;">setSource</span><span style="
      color:#000000;">(</span><span style=" color:#800080;">QUrl</span><span
      style=" color:#000000;">(</span><span style=" color:#008000;">"qrc:/qml/qml/IncEdit.qml"</span><span
      style=" color:#000000;">));</span>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800000;">m_incEditView</span><span style=" color:#000000;">-></span><span style=" color:#000000;">show</span><span style=" color:#000000;">();</span></pre>
    <span style=" color:#000000;">}@</span> <br>
    <br>
    I init my main window this way (shortened for readability):<br>
    @
    <p><span style=" color:#808000;">bool</span><span style="
        color:#c0c0c0;"> </span><span style=" color:#800080;">Controller</span><span
        style=" color:#000000;">::</span><span style=" color:#000000;">initView</span><span
        style=" color:#000000;">()</span><span style=" color:#c0c0c0;">
      </span><span style=" color:#000000;">{</span> </p>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">m_component</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QSharedPointer</span><span style=" color:#000000;"><</span><span style=" color:#800080;">QQmlComponent</span><span style=" color:#000000;">>(</span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QQmlComponent</span><span style=" color:#000000;">(</span><span style=" color:#000000;">&</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">m_engine</span><span style=" color:#000000;">));</span></pre>
    <span style=" color:#c0c0c0;">        </span><span style="
      color:#800000;">m_component</span><span style=" color:#000000;">-></span><span
      style=" color:#000000;">loadUrl</span><span style="
      color:#000000;">(</span><span style=" color:#800080;">QUrl</span><span
      style=" color:#000000;">(</span><span style=" color:#000080;">QStringLiteral</span><span
      style=" color:#000000;">(</span><span style=" color:#008000;">"qrc:/qml/qml/main.qml"</span><span
      style=" color:#000000;">)));</span><span style=" color:#c0c0c0;">
    </span><span style=" color:#800000;"><br>
              m_topLevel</span><span style=" color:#c0c0c0;"> </span><span
      style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span
      style=" color:#800080;">QSharedPointer</span><span style="
      color:#000000;"><</span><span style=" color:#800080;">QObject</span><span
      style=" color:#000000;">>(</span><span style=" color:#800000;">m_component</span><span
      style=" color:#000000;">-></span><span style="
      font-style:italic; color:#000000;">create</span><span style="
      color:#000000;">());</span><br>
            <span style=" color:#800000;">m_window</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">qobject_cast</span><span
      style=" color:#000000;"><</span><span style=" color:#800080;">QQuickWindow</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*>(</span><span
      style=" color:#800000;">m_topLevel</span><span style="
      color:#000000;">.</span><span style=" color:#000000;">data</span><span
      style=" color:#000000;">());</span><span style=" color:#c0c0c0;"><br>
              </span><span style=" color:#800000;">m_window</span><span
      style=" color:#000000;">-></span><span style=" color:#000000;">showMaximized</span><span
      style=" color:#000000;">();</span><span style=" color:#000000;"></span><span
      style=" color:#c0c0c0;"><br>
               </span><span style=" color:#808000;">return</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#808000;">true</span><span
      style=" color:#000000;">;</span>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">}@</span></pre>
    <br>
    Kind regards,<br>
    Sebastian<br>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.classintouch.de">http://www.classintouch.de</a> - Tablet-Software für Lehrer</pre>
  </body>
</html>