|
|
@ -1,9 +1,11 @@ |
|
|
|
#include "MainWindow.h" |
|
|
|
#include "ui_MainWindow.h" |
|
|
|
#include <QKeyEvent> |
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) |
|
|
|
MainWindow::MainWindow(QWidget* parent) |
|
|
|
: QMainWindow(parent) |
|
|
|
, ui(new Ui::MainWindow) |
|
|
|
, openCLManager(new OpenCLManager()) |
|
|
|
{ |
|
|
|
ui->setupUi(this); |
|
|
|
} |
|
|
@ -11,5 +13,19 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
MainWindow::~MainWindow() |
|
|
|
{ |
|
|
|
delete ui; |
|
|
|
delete openCLManager; |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::keyPressEvent(QKeyEvent* event) |
|
|
|
{ |
|
|
|
if(event->key() == Qt::Key_1) |
|
|
|
{ |
|
|
|
std::cout << "Simulating system suspend..." << std::endl; |
|
|
|
openCLManager->handleSuspendResume(true); //Simulate suspend
|
|
|
|
} |
|
|
|
else if(event->key() == Qt::Key_2) |
|
|
|
{ |
|
|
|
std::cout << "Simulating system resume..." << std::endl; |
|
|
|
openCLManager->handleSuspendResume(false); //Simulate resume
|
|
|
|
} |
|
|
|
} |
|
|
|