[Android-development] QQuickView dialog hidden behind QML ApplicationWindow on Android

info at classintouch.de info at classintouch.de
Tue Aug 23 11:50:25 CEST 2016


Anyone?

Android seems to behave quite differently here (compared to Windows) and 
I haven't found a feasible workaround - except from instantiating 
dialogs from QML, which is not flexible enough for my needs.

  * Qt 5.5.1  (I can't upgrade Qt yet, because of a dependency with
    issues on >= 5.6)
  * Win10 build system
  * GCC 4.9, armeabi-v7a, SDK is android-23
  * devices: SGS5, Nexus 10

It may well be a stupid question, I am afraid. I am no pro at all.

TIA for your time and attention!

Best regards,

Sebastian


Am 18.08.2016 um 12:00 schrieb info at classintouch.de:
> Hi,
> I have a project without widgets. Opening a QQuickView as a modal 
> dialog works fine on Windows.
> On Android, though, the QQuickView is hidden behind the main window 
> (which is of QML type "ApplicationWindow").
> I've tried
>     @new QQuickView()@
> as well as
>     @new QQuickView(controller->engine(),controller->topLevelWindow())@
> (topLevelWindow() returns a QQuickWindow, engine() returns a 
> QQmlApplicationEngine)
>
> I've also played around with WindowFlags - to no avail.
>
> Any idea on how to bring the QuickView to the front?
> -------------------------------------------------------------------------------
> More info:
>
> 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.
> This is how I open the Dialog:
>
> @voidAbstractApp::openIncEditView(QStringtitle,QStringinterfaceName,QVariantinterfaceVariant) 
>
> { m_incEditView=newMyQQuickView();
> m_incEditView->setResizeMode(QQuickView::SizeRootObjectToView);
> m_incEditView->setWidth(500);
> m_incEditView->setHeight(200);
> m_incEditView->setModality(Qt::ApplicationModal);
> m_incEditView->setFlags(Qt::Dialog);
> m_incEditView->setSource(QUrl("qrc:/qml/qml/IncEdit.qml"));
> m_incEditView->show();
> }@
>
> I init my main window this way (shortened for readability):
> @
>
> boolController::initView(){
>
> this->m_component=QSharedPointer<QQmlComponent>(newQQmlComponent(&this->m_engine));
> m_component->loadUrl(QUrl(QStringLiteral("qrc:/qml/qml/main.qml")));
>         m_topLevel=QSharedPointer<QObject>(m_component->create());
> m_window=qobject_cast<QQuickWindow*>(m_topLevel.data());
> m_window->showMaximized();
> returntrue;
> }@
>
> Kind regards,
> Sebastian
> -- 
> http://www.classintouch.de  - Tablet-Software für Lehrer
>
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development

-- 
http://www.classintouch.de  - Tablet-Software für Lehrer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20160823/be7216c7/attachment.html>


More information about the Android-development mailing list