首页 文章

按qml按钮但没有响应

提问于
浏览
0

我使用下面的代码设置一个按钮

Button {
    x: 141
    y: 312
    width: 98
    height: 22
    text: qsTr("Hello World")
    anchors.verticalCenterOffset: 116
    anchors.horizontalCenterOffset: -59
    anchors.centerIn: parent

    MouseArea
            {
                anchors.rightMargin: 126
                anchors.bottomMargin: -172
                anchors.leftMargin: -126
                anchors.topMargin: 172
                preventStealing: true
                anchors.fill: parent
                onPressed: {
                    console.debug("clicked!")

                }


            }
}

按下按钮'你好世界'它应该显示点击控制台 .

但是当我点击按钮时看起来没有任何反应

enter image description here

您的评论欢迎

1 回答

相关问题