24 lines
506 B
C++
24 lines
506 B
C++
|
|
#include "runtimeDialog.h"
|
||
|
|
#include <QVBoxLayout>
|
||
|
|
#include <QKeyEvent>
|
||
|
|
|
||
|
|
RuntimeDialog::RuntimeDialog(QWidget *parent)
|
||
|
|
: QDialog(parent,Qt::FramelessWindowHint)
|
||
|
|
{
|
||
|
|
_layout = new QVBoxLayout(this);
|
||
|
|
_layout->setContentsMargins(0, 0, 0, 0);
|
||
|
|
}
|
||
|
|
|
||
|
|
void RuntimeDialog::keyPressEvent(QKeyEvent* event) {
|
||
|
|
if (event->key() == Qt::Key_Escape) {
|
||
|
|
emit exitRuntime();
|
||
|
|
hide();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void RuntimeDialog::setContent(QWidget* content)
|
||
|
|
{
|
||
|
|
if(content)
|
||
|
|
_layout->addWidget(content);
|
||
|
|
}
|