-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
32 lines (24 loc) · 871 Bytes
/
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
#include <QApplication>
#include <QScreen>
#include "screenshot.h"
#include "options.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Options options;
//options.show();
Screenshot screenshot;
screenshot.setOptions(&options);
//screenshot.move(screenshot.screen()->availableGeometry().topLeft() + QPoint(20, 20));
//screenshot.showFullScreen();
//screenshot.hide();
auto hotkey = new QHotkey(QKeySequence("ctrl+shift+L"), true, &app);//The hotkey will be automatically registered
qDebug() << "Hotkey is Registered: " << hotkey->isRegistered();
QObject::connect(hotkey, &QHotkey::activated, qApp, [&](){
//qDebug() << "Hotkey Activated - the application will quit now";
//qApp->quit();
//Screenshot* screenshot = new Screenshot();
screenshot.takeNewScreenshot();
});
return app.exec();
}