Scanframe Modular Application
0.1.0
Loading...
Searching...
No Matches
Widget.h
Go to the documentation of this file.
1
#pragma once
2
#include <QFocusEvent>
3
#include <QTimer>
4
#include <QWidget>
5
#include <
misc/global.h
>
6
7
namespace
sf
8
{
9
13
class
_MISC_CLASS
Widget
:
public
QWidget
14
{
15
Q_OBJECT
16
17
public
:
22
explicit
Widget
(QWidget* parent =
nullptr
);
23
27
~Widget
()
override
;
28
32
Q_SIGNAL
void
activityChange
();
33
34
protected
:
39
virtual
void
emitActivityChange
();
40
42
bool
event
(QEvent* event)
override
;
43
44
private
:
46
QTimer* _timer;
48
int
_idleTimeoutMs;
49
};
50
51
}
// namespace sf
sf::Widget
Widget adding an activity change signal for e.g. updating QActions.
Definition
Widget.h:14
sf::Widget::event
bool event(QEvent *event) override
Overriding event to intercept all events for the widget.
sf::Widget::emitActivityChange
virtual void emitActivityChange()
Is called when the timer times out or instantly when getting or loosing focus. Can be overloaded in d...
sf::Widget::~Widget
~Widget() override
Overridden virtual destructor.
sf::Widget::Widget
Widget(QWidget *parent=nullptr)
Default Qt constructor.
sf::Widget::activityChange
Q_SIGNAL void activityChange()
Signal emitted when the widget becomes idle.
global.h
_MISC_CLASS
#define _MISC_CLASS
Definition
misc/global.h:40
sf
Definition
Application.h:10
src
com
misc
qt
Widget.h
Generated by
1.9.8