ToolTipArea QML Type
An Item managing a Plasma-themed tooltip. More...
| Import Statement: | import org.kde.plasma.core |
Properties
- active : bool
- containsMouse : bool
- icon : var
- image : var
- interactive : bool
- location : Plasma::Types::Location
- mainItem : Item
- mainText : string
- subText : string
- textFormat : enumeration
- timeout : int
Signals
- aboutToShow()
- toolTipVisibleChanged(bool toolTipVisible)
Methods
- void hideImmediately()
- void hideToolTip()
- void showToolTip()
Detailed Description
It is rendered in its own window. You can either specify icon, mainText and subText, or a custom Component that will be put inside the tooltip. By default the tooltip will be rendered when hovering over the parent item.
The item inside the ToolTipArea is loaded on demand and will be destroyed when the tooltip is being hidden.
Example usage:
import org.kde.plasma.core as PlasmaCore import org.kde.kirigami 2.20 as Kirigami Kirigami.Icon { PlasmaCore.ToolTipArea { mainText: i18n("Tooltip Title") subText: i18n("Some explanation.") icon: "plasma" // alternatively, you can specify your own component // to be loaded when the tooltip shows mainItem: YourCustomItem { } } }
Property Documentation
active : bool
Property that controls if a tooltips will show on mouse over. The default is true.
containsMouse : bool
Returns whether the mouse is inside the item
icon : var
An icon for this tooltip, accepted values are an icon name, a QIcon, QImage or QPixmap
image : var
TODO: single property for images? An image for this tooltip, accepted values are an icon name, a QIcon, QImage or QPixmap
interactive : bool
If interactive is false (default), the tooltip will automatically hide itself as soon as the mouse leaves the tooltiparea, if is true, if the mouse leaves tooltiparea and goes over the tooltip itself, the tooltip won't hide, so it will be possible to interact with tooltip contents.
location : Plasma::Types::Location
Plasma Location of the dialog window. Useful if this dialog is a popup for a panel
mainItem : Item
The item shown inside the tooltip.
mainText : string
The main text of this tooltip
subText : string
The description of this tooltip
textFormat : enumeration
How to handle the text format of the tooltip subtext:
- Text.AutoText (default)
- Text.PlainText
- Text.StyledText
- Text.RichText
Note: in the default implementation the main text is always plain text
timeout : int
Timeout in milliseconds after which the tooltip will hide itself. Set this value to -1 to never hide the tooltip automatically.
Signal Documentation
aboutToShow()
Emitted just before the tooltip dialog is shown.
Note: The corresponding handler is onAboutToShow.
toolTipVisibleChanged(bool toolTipVisible)
Emitted when the tooltip's visibility changes.
Note: The corresponding handler is onToolTipVisibleChanged.
Method Documentation
void hideImmediately()
Hides the tooltip immediately, in comparison to hideToolTip.
void hideToolTip()
Hides the tooltip after a grace period if shown. Does not affect whether the tooltip area is active.
void showToolTip()
Shows the tooltip.