QML中的SVG在Android上无法显示

5

我有一个Qt项目,在我的QML中包含了一个SVG图像。

   Image {
    id: logo
    width: 90
    height: 25
    source: "logoHorizontalWhite.svg"
    y:25
    anchors.horizontalCenter: parent.horizontalCenter
}

我在我的.pro文件中添加了XML和SVG支持。

    QT += qml quick widgets svg xml

在iOS和桌面上显示正确,在Android上出现错误:
W/EGL_emulation(13992): eglSurfaceAttrib未实现 W/OpenGLRenderer(13992): 无法在表面0xa4a10520上设置EGL_SWAP_BEHAVIOR,错误=EGL_SUCCESS D/Qt(13992): (null):0 ((null)): FT_New_Face索引0失败:90 W/Qt(13992): qrc:/LoginForm.qml:21 ((null)): qrc:/LoginForm.qml:21:5: QML Image: 图像数据无效:qrc:/logoHorizontalWhite.svg W/EGL_emulation(13992): eglSurfaceAttrib未实现 W/OpenGLRenderer(13992): 无法在表面0xa4a10520上设置EGL_SWAP_BEHAVIOR,错误=EGL_SUCCESS
有什么想法是什么导致这种情况的吗?谢谢!
1个回答

2
重新启动模拟器解决了这个问题。

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