-
Notifications
You must be signed in to change notification settings - Fork 0
/
makecrosswordthread.h
67 lines (53 loc) · 1.21 KB
/
makecrosswordthread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef MAKECROSSWORDTHREAD_H
#define MAKECROSSWORDTHREAD_H
#include <QDebug>
#include <QThread>
#include <QString>
#include <QtSql>
#include <QSqlQuery>
#include <QSqlError>
#include <QStack>
#include <QList>
#include <QVariant>
#include "crosswordinfo.h"
class wordData
{
public:
int id;
QString word;
QString question;
bool used;
public:
wordData()
{
id = 0;
used = false;
}
};
class makeCrosswordThread : public QThread
{
Q_OBJECT
public:
explicit makeCrosswordThread(QList<wordInfo*> &lwi, QObject *parent = 0);
void startScanning(void);
void stopScanning(void);
void setData(QList<wordInfo*> &lwi);
void setVocabulary(int vocabulary);
protected:
void run(void);
bool findWord(int curWord);
QString createTemplate(int curWord);
void clearWord(int crossedWord);
signals:
void showStatusBarMessage(QString msg);
public slots:
private:
bool stop;
QList<wordInfo*> &wi;
QStack<int> workStack;
int vocabularyId;
// кількість слів в словнику по якому складаємо кросворд
int numberOfWordsInVocabulary;
QList<wordData*> wd;
};
#endif // MAKECROSSWORDTHREAD_H