-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
70 lines (63 loc) · 1.68 KB
/
mainwindow.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
68
69
70
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QRandomGenerator>
#include <QDateTime>
#include <QFile>
#include <QFileDialog>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
/**
* @brief on_pushButtonGenerate_clicked
* @details Generates an image with random colored pixels*/
void on_pushButtonGenerate_clicked();
/**
* @brief on_pushButtonSave_clicked
* @details Saves image to a png file
*/
void on_pushButtonSave_clicked();
private:
Ui::MainWindow *ui;
QGraphicsScene *scene;
QImage myImage;
/**
* @brief ranGen
* @details Creates a cryptographically secure random number generator\n
* using QRandomGenerator::system() and securely seeding it.
*/
QRandomGenerator ranGen = QRandomGenerator::securelySeeded();
/**
* @brief initializeApp
* @details Initializes the application, draws the initial image
*/
void initializeApp();
/**
* @brief genRand
* @param max max number to generate
* @return qint64 random number
* @details Generates a random number between 0 and max
*/
qint64 genRand(qint64 max);
/**
* @brief getRandomColor
* @return QRgb random color
* @details Generates a Qrgb random color object
*/
QRgb getRandomColor();
/**
* @brief getRandomGreyScale
* @return Qrgb random grey color object
* @details Generates a QRgb random grey object
*/
QRgb getRandomGreyScale();
};
#endif // MAINWINDOW_H