LeechCraft  %{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LeechCraft::Util::ToolTipItem Class Reference

ToolTip for Qml objects. More...

#include "tooltipitem.h"

+ Inheritance diagram for LeechCraft::Util::ToolTipItem:
+ Collaboration diagram for LeechCraft::Util::ToolTipItem:

Public Slots

void showToolTip ()
 

Signals

void textChanged ()
 
void containsMouseChanged ()
 

Public Member Functions

 ToolTipItem (QDeclarativeItem *parent=0)
 
void SetText (const QString &text)
 
QString GetText () const
 
bool ContainsMouse () const
 
void ShowToolTip (const QString &text) const
 

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 

Detailed Description

ToolTip for Qml objects.

Using the tooltip is pretty easy. First of all register tooltip in your widget:

qmlRegisterType<Util::ToolTipItem> ("org.LC.common", 1, 0, "ToolTip");

Then in yout qml import this widget:

1 import org.LC.common 1.0

And now you can use tooltip:

1 Rectangle {
2  anchors.fill: parent
3 
4  MouseArea
5  {
6  anchors.fill: subjectText
7  hoverEnabled: true
8  ToolTip
9  {
10  anchors.fill: parent
11  text: "tooltip text"
12  }
13  }
14  }

Definition at line 71 of file tooltipitem.h.

Constructor & Destructor Documentation

LeechCraft::Util::ToolTipItem::ToolTipItem ( QDeclarativeItem *  parent = 0)

Definition at line 38 of file tooltipitem.cpp.

References showToolTip().

+ Here is the call graph for this function:

Member Function Documentation

bool LeechCraft::Util::ToolTipItem::ContainsMouse ( ) const

Definition at line 65 of file tooltipitem.cpp.

void LeechCraft::Util::ToolTipItem::containsMouseChanged ( )
signal

Referenced by hoverEnterEvent(), and hoverLeaveEvent().

+ Here is the caller graph for this function:

QString LeechCraft::Util::ToolTipItem::GetText ( ) const

Definition at line 60 of file tooltipitem.cpp.

void LeechCraft::Util::ToolTipItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protected

Definition at line 75 of file tooltipitem.cpp.

References containsMouseChanged().

void LeechCraft::Util::ToolTipItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protected

Definition at line 83 of file tooltipitem.cpp.

References containsMouseChanged().

void LeechCraft::Util::ToolTipItem::SetText ( const QString &  text)

Definition at line 51 of file tooltipitem.cpp.

References textChanged().

void LeechCraft::Util::ToolTipItem::ShowToolTip ( const QString &  text) const

Definition at line 70 of file tooltipitem.cpp.

Referenced by showToolTip().

+ Here is the caller graph for this function:

void LeechCraft::Util::ToolTipItem::showToolTip ( )
slot

Definition at line 91 of file tooltipitem.cpp.

References ShowToolTip().

Referenced by ToolTipItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void LeechCraft::Util::ToolTipItem::textChanged ( )
signal

Referenced by SetText().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files: