Pointer

APIRendererItemPointer

Rectangle {
    width: 100
    height: 100
    color: 'green'
    if (this.pointer.hover) {
        color: 'red'
    }
}

Source

Enables mouse and touch handling.

Source

Pointer::enabled

Type:
Boolean
Default value:
true

Pointer::onEnabledChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal

Source

Pointer::draggable

Type:
Boolean
Default value:
false
Not Implemented

Pointer::onDraggableChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal
Not Implemented

Source

Pointer::dragActive

Type:
Boolean
Default value:
false
Not Implemented

Pointer::onDragActiveChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal
Not Implemented

Source

Pointer::onClick(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onPress(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onRelease(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onEnter(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onExit(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onWheel(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Pointer::onMove(event)

Parameters:
  • event — Item.Pointer.Event
Type:
Signal

Source

Pointer::pressed

Type:
Boolean
Default value:
false

Whether the pointer is currently pressed.

Pointer::onPressedChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal

Source

Pointer::hover

Type:
Boolean
Default value:
false

Whether the pointer is currently under the item.

Pointer::onHoverChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal

Source

Class Pointer.Event

Extends:
Device.PointerEvent

Events order:

  1. Press
  2. Enter
  3. Move
  4. Move (not captured ensured items)
  5. Exit
  6. Release
  7. Click
  8. Exit (entered items on touch devices)
  9. Release (not captured ensured items)

Stopped 'Enter' event will emit 'Move' event on this item.

Stopped 'Exit' event will emit 'Release' event on this item.

Source

PointerEvent::itemX

Type:
Float
Read Only

Represents pointer horizontal position in a local item coordinate system.

Is not available inside onExit event and for move or release ensured items.

Source

PointerEvent::itemY

Type:
Float
Read Only

Represents pointer vertical position in a local item coordinate system.

Is not available inside onExit event and for move or release ensured items.

Source

PointerEvent::stopPropagation

Type:
Boolean
Default value:
false

Enable this property to stop further event propagation.

Source

PointerEvent::checkSiblings

Type:
Boolean
Default value:
false

By default first deepest captured item will propagate this event only by his parents.

Change this value to test previous siblings as well.

Source

PointerEvent::ensureRelease

Type:
Boolean
Default value:
true

Define whether pressed item should get 'onRelease' signal even if the pointer has been released outside of this item.

Can be changed only in the 'onPress' signal.

Source

PointerEvent::ensureMove

Type:
Boolean
Default value:
true

Define whether the pressed item should get 'onMove' signals even if the pointer is outside of this item.

Can be changed only in the 'onPress' signal.

Source

PointerEvent::preventClick

Type:
Boolean
Default value:
false

Set it to true to block emitting click signals.

This property is reset on each pointer press.

It's internally used by Scrollable element to block clicks after view has been scrolled.

Source

Pointer.event

Type:
Item.Pointer.Event

Source