LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
tooltipitem.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2010-2013 Oleg Linkin <MaledictusDeMagog@gmail.com>
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <QTimer>
12 #include <QQuickItem>
13 #include "qmlconfig.h"
14 
15 namespace LC::Util
16 {
50  class UTIL_QML_API ToolTipItem : public QQuickItem
51  {
52  Q_OBJECT
53 
56  Q_PROPERTY (QString text READ GetText WRITE SetText NOTIFY textChanged)
57 
58 
60  Q_PROPERTY (bool containsMouse READ ContainsMouse NOTIFY containsMouseChanged)
61 
62  QTimer ShowTimer_;
63  QString Text_;
64  bool ContainsMouse_ = false;
65  public:
70  explicit ToolTipItem (QQuickItem *parent = nullptr);
71 
78  void SetText (const QString& text);
79 
86  QString GetText () const;
87 
92  bool ContainsMouse () const;
93 
99  void ShowToolTip (const QString& text) const;
100  protected:
101  void hoverEnterEvent (QHoverEvent*) override;
102  void hoverLeaveEvent (QHoverEvent*) override;
103  public slots:
106  void showToolTip ();
107  signals:
110  void textChanged ();
111 
114  void containsMouseChanged ();
115  };
116 }
LC::Util
Definition: icoreproxy.h:33
LC::Util::ToolTipItem
ToolTip for Qml objects.
Definition: tooltipitem.h:56
qmlconfig.h
UTIL_QML_API
#define UTIL_QML_API
Definition: qmlconfig.h:16