Empty QML Type
A list item with no contents. More...
| Import Statement: | import Lomiri.Components.ListItems 1.3 |
| Inherits: | |
| Inherited By: | Base, Expandable, SingleControl, Standard, and ValueSelector |
Properties
- backgroundIndicator : list<Item>
- confirmRemoval : bool
- divider : ThinDivider
- highlightWhenPressed : bool
- hovered : bool
- pressed : bool
- removable : bool
- selected : bool
- sensingMargins
- sensingMargins.all : real
- sensingMargins.bottom : real
- sensingMargins.left : real
- sensingMargins.right : real
- sensingMargins.top : real
- showDivider : bool
- swipingState : string
- waitingConfirmationForRemoval : bool
Signals
- clicked()
- clicked()
- itemRemoved()
- itemRemoved()
- pressAndHold()
- pressAndHold()
Methods
Detailed Description
Note: The component is deprecated. Use ListItem component instead. The Empty class can be used for generic list items containing other components such as buttons. It is selectable and can take mouse clicks. It will attempt to detect if a thin dividing line at the bottom of the item is suitable, but this behaviour can be overridden (using showDivider). For specific types of list items, see its subclasses.
The item will still remain in memory after being removed from the list so it is up to the application to destroy it. This can be handled by the signal itemRemoved that is fired after all animation is done.
Examples:
import Lomiri.Components import Lomiri.Components.ListItems as ListItem Item { Model { id: contactModel ListElement { name: "Bill Smith" number: "555 3264" } ListElement { name: "John Brown" number: "555 8426" } } ListView { width: 180; height: 200 model: contactModel delegate: ListItem.Empty { height: units.gu(6) removable: true onItemRemoved: contactModel.remove(index) Text { text: name + " " + number anchors.centerIn: parent } } } }
See the documentation of the derived classes of Empty for more examples.
Property Documentation
Defines the item background item to be showed during the item swiping
divider : ThinDivider |
Exposes our the bottom line divider.
Highlight the list item when it is pressed. This is used to disable the highlighting of the full list item when custom highlighting needs to be implemented (for example in ListItem.Standard which can have a split).
The property group specifies the margins extending the visual area where the touch events are sensed. Positive values mean the area will be extended on the specified direction outside of the visual area, negative values mean the sensing will fall under the component's visual border. All values default to 0. This does not affect mouse sensing area, which only covers the visual area of the component.
Note: If the visual area and the sensing margins are not reaching the 4x4 grid units limit, the component will fall back to these minimum limits. For example, extending a 2x2 grid unit visual component into 5x4 grid units sensing area would look as follows:
AbstractButton { width: units.gu(2) height: units.gu(2) Icon { name: "settings" } sensingArea { // no need to set the vertical direction as the minimum of // 4 grid units will be taken automatically leftMargin: units.gu(1) // we only have to add 2 grid units as the width + left margin // already gives us 3 grid units out of 5 rightMargin: units.gu(2) } }
Set to show or hide the thin bottom divider line (drawn by the ThinDivider component). This line is shown by default except in cases where this item is the delegate of a ListView.
Defines if the item is waiting for the user interaction during the swipe to delete
Signal Documentation
This handler is called when there is a mouse click on the button and the button is not disabled. If action is defined, the action will be triggered.
Note: The corresponding handler is onClicked.
This handler is called when there is a mouse click on the button and the button is not disabled. If action is defined, the action will be triggered.
Note: The corresponding handler is onClicked.
This handler is called when the item is removed from the list
Note: The corresponding handler is onItemRemoved.
This handler is called when the item is removed from the list
Note: The corresponding handler is onItemRemoved.
This handler is called when there is a long press.
Note: The corresponding handler is onPressAndHold.
This handler is called when there is a long press.
Note: The corresponding handler is onPressAndHold.