Den 05-10-2012 13:59, Satya Praveen Ganapathi skrev:
Hi,
I have a custome button "Button.qml" and I'm using this in another qml
"menu.qml"
*Button.qml*
Recatangle{
//some properties
Text{
Id:button
//
}
}
*menu.qml*
**
ViewPort{
Item{
//Button.qml
Button{
Id:button1
}
Button{
Id:button2
}
}
}
Now I'm unable to highlight these buttons in "menu.qml".
I want to use an image to highlight these buttons and move the
highlight to next button on key down, move to previous button on key
up respectively. On pressing "enter" I have to load another qml file.
You need to add a MouseArea to your button. Something like this should
do the trick:
Button.qml:
Rectangle {
color: "green"
Text {...}
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
}
Image {
anchors.fill: parent
visible: mouse.containsMouse
source: "images/myhoverbackground.png"
}
}
This will switch background color from green to the hover image on mouse
hover.
Bo Thorsen.
Fionia Software - Qt experts for hire.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest