Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
StdInputListener.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File: InputListener.h
3//-----------------------------------------------------------------------------
4// Project: Kactus2
5// Author: Esko Pekkarinen
6// Date: 04.02.2021
7//
8// Description:
9// <Short description of the class/file contents>
10//-----------------------------------------------------------------------------
11
12#ifndef STDINPUTLISTENER_H
13#define STDINPUTLISTENER_H
14
15#include <QObject>
16
17#ifdef Q_OS_WIN
18#include <windows.h>
19#include <QWinEventNotifier>
20#else
21#include <QSocketNotifier>
22#endif
23
24class WriteChannel;
25
26class StdInputListener : public QObject
27{
28 Q_OBJECT
29public:
30
32 StdInputListener(WriteChannel* outputChannel, QObject* parent = nullptr);
33
35 virtual ~StdInputListener() = default;
36
37signals:
38
40
41public slots:
42
43 void inputReadable();
44
45private:
46
47 WriteChannel* outputChannel_;
48
49#ifdef Q_OS_WIN
50 QWinEventNotifier* notifier_;
51#else
52 QSocketNotifier* notifier_;
53#endif
54
55};
56
57
58#endif // STDINPUTLISTENER_H
virtual ~StdInputListener()=default
The destructor.
StdInputListener(WriteChannel *outputChannel, QObject *parent=nullptr)
The constructor.