Ai
2 Star 5 Fork 0

CalmReason/learn-qt-with-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mainwindow.cpp 370 Bytes
一键复制 编辑 原始数据 按行查看 历史
CalmReason 提交于 2023-07-23 18:28 +08:00 . Key_Escape
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QKeyEvent>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::keyPressEvent(QKeyEvent *event)
{
if(event->key() == Qt::Key_Escape)
{
this->close();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/carea/learn-qt-with-code.git
git@gitee.com:carea/learn-qt-with-code.git
carea
learn-qt-with-code
learn-qt-with-code
master

搜索帮助