LeechCraft
0.6.70-17609-g3dde4097dd
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
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::ToolTipItem::showToolTip
void showToolTip()
Shows the tooltip immediately.
Definition
tooltipitem.cpp:66
LC::Util::ToolTipItem::hoverEnterEvent
void hoverEnterEvent(QHoverEvent *) override
Definition
tooltipitem.cpp:50
LC::Util::ToolTipItem::text
QString text
The text of this tooltip item (rich text supported).
Definition
tooltipitem.h:56
LC::Util::ToolTipItem::ContainsMouse
bool ContainsMouse() const
Returns whether the tooltip contains the mouse.
Definition
tooltipitem.cpp:40
LC::Util::ToolTipItem::containsMouse
bool containsMouse
Whether this tooltip contains mouse.
Definition
tooltipitem.h:60
LC::Util::ToolTipItem::GetText
QString GetText() const
Returns the text of this tooltip.
Definition
tooltipitem.cpp:35
LC::Util::ToolTipItem::ShowToolTip
void ShowToolTip(const QString &text) const
Shows tooltip with the given text immediately.
Definition
tooltipitem.cpp:45
LC::Util::ToolTipItem::containsMouseChanged
void containsMouseChanged()
Emitted when the containsMouse property changes.
LC::Util::ToolTipItem::ToolTipItem
ToolTipItem(QQuickItem *parent=nullptr)
Constructs the tooltip with the given parent item.
Definition
tooltipitem.cpp:15
LC::Util::ToolTipItem::textChanged
void textChanged()
Emitted when the text of this tooltip changes.
LC::Util::ToolTipItem::SetText
void SetText(const QString &text)
Sets the text contained in this tooltip to text.
Definition
tooltipitem.cpp:26
LC::Util::ToolTipItem::hoverLeaveEvent
void hoverLeaveEvent(QHoverEvent *) override
Definition
tooltipitem.cpp:58
LC::Util
Definition
icoreproxy.h:34
qmlconfig.h
UTIL_QML_API
#define UTIL_QML_API
Definition
qmlconfig.h:16
src
util
qml
tooltipitem.h
Generated by
1.13.2