LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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
15namespace 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
115 };
116}
void showToolTip()
Shows the tooltip immediately.
void hoverEnterEvent(QHoverEvent *) override
QString text
The text of this tooltip item (rich text supported).
Definition tooltipitem.h:56
bool ContainsMouse() const
Returns whether the tooltip contains the mouse.
bool containsMouse
Whether this tooltip contains mouse.
Definition tooltipitem.h:60
QString GetText() const
Returns the text of this tooltip.
void ShowToolTip(const QString &text) const
Shows tooltip with the given text immediately.
void containsMouseChanged()
Emitted when the containsMouse property changes.
ToolTipItem(QQuickItem *parent=nullptr)
Constructs the tooltip with the given parent item.
void textChanged()
Emitted when the text of this tooltip changes.
void SetText(const QString &text)
Sets the text contained in this tooltip to text.
void hoverLeaveEvent(QHoverEvent *) override
#define UTIL_QML_API
Definition qmlconfig.h:16