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

时间:2014-05-08 17:35:03

标签: android qt qt-creator qml customdialog

我试图在真正的Android设备(三星galaxy express)上显示自定义QML对话框,但它不起作用,它也使应用程序停止运行。但是,当我在Qt创建者环境中运行应用程序时,一切正常!

当必须显示对话框时,Qt创建者上的应用输出会显示如下内容:

  

W / Adreno200-EGL(26802):: EGL_BAD_ACCESS   E / libEGL(26802):eglMakeCurrent:534错误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 个答案:

答案 0 :(得分:1)

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