![]() |
LeechCraft
0.6.70-3565-g2d86529
Modular cross-platform feature rich live environment.
|
ToolTip for Qml objects. More...
#include "tooltipitem.h"
Public Slots | |
void | showToolTip () |
Shows the tooltip immediately. More... | |
Signals | |
void | textChanged () |
Emitted when the text of this tooltip changes. More... | |
void | containsMouseChanged () |
Emitted when the containsMouse property changes. More... | |
Public Member Functions | |
ToolTipItem (QDeclarativeItem *parent=nullptr) | |
Constructs the tooltip with the given parent item. More... | |
void | SetText (const QString &text) |
Sets the text contained in this tooltip to text. More... | |
QString | GetText () const |
Returns the text of this tooltip. More... | |
bool | ContainsMouse () const |
Returns whether the tooltip contains the mouse. More... | |
void | ShowToolTip (const QString &text) const |
Shows tooltip with the given text immediately. More... | |
Protected Member Functions | |
void | hoverEnterEvent (QGraphicsSceneHoverEvent *) override |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *) override |
Properties | |
QString | text |
The text of this tooltip item (rich text supported). More... | |
bool | containsMouse |
Whether this tooltip contains mouse. More... | |
QTimer | ShowTimer_ |
QString | Text_ |
bool | ContainsMouse_ = false |
ToolTip for Qml objects.
Rich text is supported.
Using the tooltip is pretty easy. First of all register tooltip in your widget:
Then in yout qml import this widget:
And now you can use tooltip:
Definition at line 76 of file tooltipitem.h.
LeechCraft::Util::ToolTipItem::ToolTipItem | ( | QDeclarativeItem * | parent = nullptr | ) |
Constructs the tooltip with the given parent item.
[in] | parent | The parent item for this tooltip. |
Definition at line 39 of file tooltipitem.cpp.
References ShowTimer_, and showToolTip().
bool LeechCraft::Util::ToolTipItem::ContainsMouse | ( | ) | const |
Returns whether the tooltip contains the mouse.
Definition at line 68 of file tooltipitem.cpp.
References ContainsMouse_.
|
signal |
Emitted when the containsMouse property changes.
QString LeechCraft::Util::ToolTipItem::GetText | ( | ) | const |
Returns the text of this tooltip.
Definition at line 63 of file tooltipitem.cpp.
References Text_.
|
overrideprotected |
Definition at line 79 of file tooltipitem.cpp.
|
overrideprotected |
Definition at line 95 of file tooltipitem.cpp.
void LeechCraft::Util::ToolTipItem::SetText | ( | const QString & | text | ) |
Sets the text contained in this tooltip to text.
[in] | text | The text of this tooltip. |
Definition at line 54 of file tooltipitem.cpp.
References text, Text_, and textChanged().
void LeechCraft::Util::ToolTipItem::ShowToolTip | ( | const QString & | text | ) | const |
Shows tooltip with the given text immediately.
The passed text overrides the text property of this tooltip, but does not change it.
Definition at line 73 of file tooltipitem.cpp.
Referenced by showToolTip().
|
slot |
Shows the tooltip immediately.
Definition at line 110 of file tooltipitem.cpp.
References ShowToolTip(), and Text_.
Referenced by ToolTipItem().
|
signal |
Emitted when the text of this tooltip changes.
Referenced by SetText().
|
read |
Whether this tooltip contains mouse.
Definition at line 89 of file tooltipitem.h.
bool LeechCraft::Util::ToolTipItem::ContainsMouse_ = false |
Definition at line 93 of file tooltipitem.h.
Referenced by ContainsMouse().
QTimer LeechCraft::Util::ToolTipItem::ShowTimer_ |
Definition at line 91 of file tooltipitem.h.
Referenced by ToolTipItem().
|
readwrite |
The text of this tooltip item (rich text supported).
Definition at line 85 of file tooltipitem.h.
Referenced by SetText().
QString LeechCraft::Util::ToolTipItem::Text_ |
Definition at line 92 of file tooltipitem.h.
Referenced by GetText(), SetText(), and showToolTip().