-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
50 lines (42 loc) · 1.68 KB
/
mainwindow.h
File metadata and controls
50 lines (42 loc) · 1.68 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
// подключение необходимых библиотек
#include <QWidget>
#include <QTimer>
#include <QTextCodec>
#include <QFont>
#include <QTextStream>
#include <QFile>
#include <ctime>
#include <QFileDialog>
#include <resultwindow.h> // заголовок класса окна для вывода результатов
#include <infowindow.h>
#include <QKeyEvent>
namespace Ui {
class MainWindow;
}
class MainWindow : public QWidget
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
// прототипы слотов класса
void Info();
void Open(); // загрузка файла
void on_fontComboBox_currentFontChanged(const QFont &f); // изменение шрифта
void UpdateTimer(); // обновление таймера в главном окне
void on_spinBox_valueChanged(const QString &arg1); // изменение размера шрифта
private:
QTimer timer; // таймер
Ui::MainWindow *ui;
bool started = false; // переменная, определяющая, был ли запущен тест
bool loaded = false; // переменная, определяющая, был ли загружен файл
int wordNumber; // количество слов в тексте
time_t startTime; // время начала отсчета
time_t finishTime; // время конца отсчета
protected:
virtual void keyReleaseEvent(QKeyEvent* event); // прототип обработчика событий клавиатуры
};
#endif // MAINWINDOW_H