Hi,

Well for the thumbnail visualization example, it would be easier to have the
mouse area in the delegate rectangle,then react to hover + mouse enter event
to increase the size of the rectangle (or the image..you can try to use
states and transitions for this....)

Row {
  id: row
  Repeater {
    model: 5
    delegate:
   Rectangle {
             width: 50;
             height: 10
             MouseArea {
                     anchors.fill: parent
                    onEnter: { /* increase in size*/ }
                    onExited: { /*go back to original size*/}
                }
        }
   }
}

you may also want to look at childAt(x,y) method in QML item.

thanks,
Sarvesh



On Thu, Mar 17, 2011 at 8:38 PM, Matti Mäki <[email protected]> wrote:

> Hi,
>
> If I set a MouseArea to fill a Row with Repeater-generated content, is
> it possible to know which generated item is currently under mouse cursor?
>
> I'd like to use MouseArea's onPositionChanged-event to do some things
> for a Row item when mouse cursor is moving over it. From MouseEvent I
> get the cursor xy-coordinates but is there a reasonable way of mapping
> them to a Row item?
>
> e.g.
>
> Row {
>   id: row
>   Repeater {
>     model: 5
>     delegate: Rectangle { width: 50; height: 10 }
>   }
> }
> MouseArea {
>   anchors.fill: row
>   onPositionChanged: { /* get row item under x,y and do something with
> it */ }
> }
>
> Or any other way of implementing similar functionality?
>
> This would allow a nice visualization effect e.g. when you show image
> thumbnails within a grid. While moving your mouse around the grid, the
> thumbnail under cursor would show up as a larger image and then fade
> back to thumbnail as the mouse cursor moves forward to the next item.
>
> Br,
> matti
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to