gpt4 book ai didi

android - Qt qml : Custom dialog not displayed on device, 应用程序崩溃

转载 作者:太空狗 更新时间:2023-10-29 14:14:40 24 4
gpt4 key购买 nike

我正在尝试在真实的 Android 设备(samsung 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
} ...

有什么建议吗?

最佳答案

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

关于android - Qt qml : Custom dialog not displayed on device, 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23548777/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com