Qt qml:自定义对话框在设备上未显示,应用程序崩溃。

4
我试图在真实的Android设备(三星Galaxy Express)上显示自定义的QML对话框,但无法正常运行,甚至导致应用停止运行。然而,当我在Qt Creator环境中运行应用程序时,一切都正常!Qt Creator上的应用输出如下所示,当应该显示对话框时:
W/Adreno200-EGL(26802): : EGL_BAD_ACCESS E/libEGL (26802): eglMakeCurrent:534 error 3002 (EGL_BAD_ACCESS) W/Qt (26802): eglconvenience/qeglplatformcontext.cpp:128 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3002, this: 0x58aebc90
我创建的自定义对话框的代码如下:
  Window {
    id: window
    visible: true
    modality: Qt.ApplicationModal
    width: 500
    height: 220
    flags: Qt.AlignCenter
    property Image imgGo1: imgGo1
    property Image imgGo2: imgGo2
    property Image imgDetectorH: imgDetectorH
    property Image imgDetectorV: imgDetectorV

    Image {
        source: "content/dialog_back.jpg"
        width: window.width
        height: window.height
    } ...

有什么建议吗?
1个回答

2
根据 "Qt 5 for Android 的解剖",Qt Android 不支持多个活动。它也无法处理多个表面(窗口)。您可以使用 DialogMessageDialog 显示简单对话框。要更改整个屏幕并创建新视图,您可以使用 StackView,它具有非常好的功能,可帮助您构建移动应用程序。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接