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.

32 lines
728 B

2 months ago
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QKeyEvent>
2 months ago
MainWindow::MainWindow(QWidget* parent)
2 months ago
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, openCLManager(new OpenCLManager())
2 months ago
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
delete openCLManager;
2 months ago
}
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
}
}