QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsfocuswatcher.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfocuswatcher.h
3
-----------------
4
Date : April 2016
5
Copyright : (C) 2016 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgsfocuswatcher.h
"
17
18
#include <QEvent>
19
20
#include "moc_qgsfocuswatcher.cpp"
21
22
QgsFocusWatcher::QgsFocusWatcher
( QObject *parent )
23
: QObject( parent )
24
{
25
Q_ASSERT( parent );
26
parent->installEventFilter(
this
);
27
}
28
29
bool
QgsFocusWatcher::eventFilter
( QObject *, QEvent *event )
30
{
31
switch
( event->type() )
32
{
33
case
QEvent::FocusIn:
34
emit
focusChanged
(
true
);
35
emit
focusIn
();
36
break
;
37
case
QEvent::FocusOut:
38
emit
focusChanged
(
false
);
39
emit
focusOut
();
40
break
;
41
default
:
42
break
;
43
}
44
return
false
;
45
}
QgsFocusWatcher::focusIn
void focusIn()
Emitted when parent object gains focus.
QgsFocusWatcher::focusChanged
void focusChanged(bool focused)
Emitted when parent object's focus changes.
QgsFocusWatcher::focusOut
void focusOut()
Emitted when parent object loses focus.
QgsFocusWatcher::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition
qgsfocuswatcher.cpp:29
QgsFocusWatcher::QgsFocusWatcher
QgsFocusWatcher(QObject *parent)
Constructor for QgsFocusWatcher.
Definition
qgsfocuswatcher.cpp:22
qgsfocuswatcher.h
Generated on
for QGIS API Documentation by
1.17.0