FlightGear
next
HoverArea.cxx
Go to the documentation of this file.
1
#include "
HoverArea.hxx
"
2
3
#include <QDebug>
4
#include <QQuickWindow>
5
6
HoverArea::HoverArea
()
7
{
8
connect(
this
, &QQuickItem::windowChanged, [
this
](QQuickWindow* win) {
9
if
(win) {
10
win->installEventFilter(
this
);
11
}
12
});
13
}
14
15
16
17
bool
HoverArea::eventFilter
(QObject *sender, QEvent *event)
18
{
19
Q_UNUSED(sender)
20
if
(event->type() == QEvent::MouseMove) {
21
QMouseEvent* me =
static_cast<
QMouseEvent*
>
(event);
22
const
auto
local = mapFromScene(me->pos());
23
const
bool
con = contains(local);
24
if
(con != m_containsMouse) {
25
m_containsMouse = con;
26
emit
containsMouseChanged
(con);
27
}
28
}
29
30
return
false
;
31
}
32
33
HoverArea.hxx
HoverArea::eventFilter
bool eventFilter(QObject *sender, QEvent *event) override
Definition
HoverArea.cxx:17
HoverArea::HoverArea
HoverArea()
Definition
HoverArea.cxx:6
HoverArea::containsMouseChanged
void containsMouseChanged(bool containsMouse)
src
GUI
HoverArea.cxx
Generated on Tue Jun 3 2025 12:58:39 for FlightGear by
1.13.2