-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
63 lines (46 loc) · 1.13 KB
/
main.cpp
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
#include <QApplication>
#include <QDesktopWidget>
#include "Views/mainwindow.h"
// v1.0.2
void setPosition(MainWindow &view) {
QDesktopWidget *w = QApplication::desktop();
int primary = w->primaryScreen();
QRect dim = w->screenGeometry(primary);
int mx,my, corr = 20;
mx = view.x();
mx = dim.width() - view.width() - corr;
my = corr;
view.move(mx, my);
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow view;
view.show();
setPosition(view);
return a.exec();
}
// void saveHuesToFile() {
// QFile file("hues.dat");
// if ( !file.open(QIODevice::WriteOnly) ) {
// qDebug("Cannot open file");
// return;
// }
// QList<QImage> hues;
// QColor color;
// int maxHue = 360;
// int max = 255;
// for (int h = 0;h<maxHue;h++) {
// QImage image(max+1, max+1, QImage::Format_RGB32);
// for (int s = 0; s<=max; s++) {
// for (int v = 0; v<=max; v++) {
// color.setHsv(h, s, v);
// image.setPixel(s, max-v, color.rgb());
// }
// }
// hues.append(image);
// }
// QDataStream stream(&file);
// stream << hues;
// file.close();
// }