Qt Quick模拟器层崩溃

huangapple go评论78阅读模式
英文:

Qt Quick emulator layer crash

问题

我在项目文件夹中创建了一个空的QT Quick应用程序和一个ui.qml文件,但无法以设计模式打开ui文件。
描述错误消息的对话框说:

行:1: Qt Quick模拟器层崩溃

查看代码的第1行,我找不到任何错误

import QtQuick 2.12
import QtQuick.Controls 2.12

Item {
    width: 400
    height: 400

    Page {
        id: page
        width: 200
        height: 200

        Button {
            id: button
        }

        CheckBox {
            id: checkBox
            text: qsTr("Check Box")
        }

        Label {
            id: label
            text: qsTr("Label")
        }
    }
}

我尝试更改QML模拟器的路径,但没有解决问题。

路径配置

Qt Quick模拟器层崩溃

问题可能是什么,如何解决?

英文:

I created an empty QT Quick Application and a ui.qml file in the project folder but I'm unable to open the ui file in design mode.
A dialog box describing error message says:

ine:1: Qt Quick emulator layer crash

Qt Quick模拟器层崩溃

Taking a look at line 1 of the code, i can't find any error

import QtQuick 2.12
import QtQuick.Controls 2.12

Item {
    width: 400
    height: 400

    Page {
        id: page
        width: 200
        height: 200

        Button {
            id: button
        }

        CheckBox {
            id: checkBox
            text: qsTr("Check Box")
        }

        Label {
            id: label
            text: qsTr("Label")
        }
    }
}

<!-- end snippet -->

I tried changing the path for the QML EMULATOR but it didn't solve the issue.

path configurations

Qt Quick模拟器层崩溃

What can be the problem and how can it be fixed?

答案1

得分: 2

今天我遇到了这个错误。但我已经成功修复了它。
你需要做的是:工具->QT Quick->QT Quick Designer->QML仿真层,选择“使用与选定的QT构建的QML仿真层”。
无需选择路径,
解决方案首次出现在这个帖子中。
https://stackoverflow.com/questions/29290631/cannot-connect-to-qml-emluation-layer-qml-puppet

英文:

I ran into this error today. But I've successfully fixed it.
You need to do this:Tool->QT Quick->QT Quick Designer->QML Emulation Layer , "Use QML Emulation Layer that is built with selected QT"
No need to choose a path,
The solution was first in this thread.
https://stackoverflow.com/questions/29290631/cannot-connect-to-qml-emluation-layer-qml-puppet

答案2

得分: 0

尝试将 "Item" 更改为 "Rectangle"。不确定为什么,但有时对我有效。

英文:

Try changing Item to Rectangle. Not sure why but it works for me sometimes.

huangapple
  • 本文由 发表于 2020年1月3日 14:34:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/59574158.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定