PresentationApp/qml/cell.qml

58 lines
1.6 KiB
QML
Raw Normal View History

2016-03-07 08:54:14 -08:00
import QtQuick 2.4
Rectangle {
2016-01-14 22:25:53 -08:00
objectName: "cellRect"
property int index: 0
height: 100
border.width: 2
2016-02-19 08:46:03 -08:00
border.color: "black"
anchors.right: parent.right
anchors.left: parent.left
Text {
id: cellText
2016-01-14 22:25:53 -08:00
enabled: true
objectName: "cellText"
text: "hello this is text\nhaha\nhdsjfklfhaskjd"
clip: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
anchors.fill: parent
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 2
2016-01-14 22:25:53 -08:00
MouseArea {
id: cellMouse
hoverEnabled: true
2016-01-14 22:25:53 -08:00
enabled: true
objectName: "cellMouse"
anchors.fill: parent
onMouseXChanged: if (containsMouse) {
parent.parent.border.color = "skyblue"
parent.parent.color = "darkblue"
parent.color = "white"
} else if (focus) {
parent.color = "black"
}
2016-03-17 09:41:21 -07:00
onExited: focusChanged(focus)
2016-02-19 08:46:03 -08:00
function notSelected() {
parent.parent.border.color = "black"
parent.parent.color = "white"
parent.color = "black"
2016-03-17 09:41:21 -07:00
MouseXChanged(mouse)
}
function selected() {
parent.parent.border.color = "blue"
parent.parent.color = "gainsboro"
2016-03-17 09:41:21 -07:00
MouseXChanged(mouse)
}
}
}
}