Hi experts!
I recently started learning qml and I am now playing with the controls a bit.
My goal is to have a checkable button. However, the property checkable doesn’t seem to have any influence on the button: The button does not remain pressed. Also, if setting checked to true, the button is not in the pressed state.
code snippet:
import QtQuick 2.0
import QtQuick.Controls 1.0
Rectangle {
width: 360
height: 360
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
Button{
text: "asdfs"
checkable: true
checked: true
}
}
some infos:
using qt5.1.1
tried it in window and ubuntu
tried “Button” as well as “ToolButton”
Did I miss something? Do you have some ideas why it is not working as intended? Thank you for any help! :)
↧