ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
macroreader.h
Go to the documentation of this file.
1 #ifndef MACROREADER_H
2 #define MACROREADER_H
3 
4 //#include <QStandardPaths>
5 #include <QObject>
6 #include <QFile>
7 #include <QThread>
8 #include <QPlainTextEdit>
9 
22 class MacroReaderThread : public QThread
23 {
24  Q_OBJECT
25 
32 
36  QString macroPath;
37 
40  QPlainTextEdit* macroBox;
41 
45  QPlainTextEdit* macroText;
46 
47 public:
55  MacroReaderThread(int macNum, QString macPath, QPlainTextEdit* macBox, QPlainTextEdit* macText) {
56  macroNumber = macNum;
57  macroPath = macPath;
58  macroBox = macBox;
59  macroText = macText;
60  }
61 
64  void run () Q_DECL_OVERRIDE;
65 
66 private slots:
79 
80  void readMacro(QString line);
81 };
82 
87 class MacroReader : public QThread
88 {
89  Q_OBJECT
90 
91 public:
95  MacroReader();
104  MacroReader(int macroNumber, QString macroPath, QPlainTextEdit* macBox, QPlainTextEdit* macText);
105  ~MacroReader();
106 
114  void startWorkInAThread(int macroNumber, QString macroPath, QPlainTextEdit* macBox, QPlainTextEdit* macText);
115 
116 signals:
117 
118 public slots:
119 
120 private slots:
121 
122 private:
124 };
125 
126 #endif // MACROREADER_H
The MacroReader class creates a worker thread object. It does a connect do delayed deletion of thread...
Definition: macroreader.h:87
QPlainTextEdit * macroText
macroText is the other textpane used in the UI while typing new macros. That variable is used for set...
Definition: macroreader.h:45
QString macroPath
macroPath holds the path for the notify channel
Definition: macroreader.h:36
void run() Q_DECL_OVERRIDE
run is the notification reader main loop.
Definition: macroreader.cpp:47
The MacroReaderThread class is responsible for reading Macro Key Values. It is created as a separate ...
Definition: macroreader.h:22
MacroReaderThread(int macNum, QString macPath, QPlainTextEdit *macBox, QPlainTextEdit *macText)
MacroReaderThread saves the four params to local vars with similar varNames.
Definition: macroreader.h:55
QPlainTextEdit * macroBox
macroBox will receive the Macro Key Values sent from the keyboard while defining a new macro...
Definition: macroreader.h:40
int macroNumber
macroNumber Filenames of nofity channels have the structure <input-device-path>/ckb1/notify<number> F...
Definition: macroreader.h:31
MacroReaderThread * macroReaderThread
Definition: macroreader.h:123
void readMacro(QString line)
readMacro is called for each line received by the worker thread. The method ist called via signal (me...
Definition: macroreader.cpp:27