我正在使用Quick 2开发我的新应用程序。最近我遇到了一个严重的问题,如下所述:
问题:当我在单击按钮的处理程序中调用Qt.quit()时,应用程序大多会崩溃。通过调试代码,我发现当运行到qquick_syncback_helper (在qquickanimatorjob.cpp中)时,它会崩溃。我的演示代码退出简单:
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.0
ApplicationWindow {
    id: window
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")
    Button{
        text: "quit"
        onClicked: Qt.quit()
        anchors.centerIn: parent
    }
}有人有什么想法吗?
PS:发现,如果快速单击按钮,应用程序将正常退出,而当单击按钮时(当按钮上的动画出现时),几乎会崩溃。
PPS:我在Windows1064bit上使用Qt 4.2.2,Qt5.8.0用于VS 2015 64位,使用QtQuickControls2,具体样式为2.1。我还没有试过QT5.9.0,但我很快就会找到答案的。
发布于 2017-05-26 00:55:23
用这个:
onPressed: Qt.quit()https://stackoverflow.com/questions/43928337
复制相似问题