You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include "MainWindow.h"
|
|
|
|
#include "ui_MainWindow.h"
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget* parent)
|
|
|
|
: QMainWindow(parent)
|
|
|
|
, ui(new Ui::MainWindow)
|
|
|
|
, openCLManager(new OpenCLManager())
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|