Commit 72318914 by NitefullWind

1. 修复按Esc键关闭窗口后Task继续进行的bug.

parent 0b5a3989
#include "fmvipwnd.h"
#include <QDebug>
#include "fmvipwnd.h"
#include <QDesktopWidget>
#include <QPainter>
#include <QStyleOption>
#include <QJsonDocument>
#include <QKeyEvent>
#ifdef Q_OS_WIN
#include <windows.h>
#include <windowsx.h>
......@@ -65,6 +65,15 @@ int FMVipWnd::exec()
return QDialog::exec();
}
void FMVipWnd::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_Escape) {
on_close_btn_clicked();
} else {
QDialog::keyPressEvent(e);
}
}
#ifdef Q_OS_WIN
//! Gui class member of platform
bool FMVipWnd::nativeEvent(const QByteArray &eventType, void *message, long *result)
......
#ifndef FMVIPWND_H
#ifndef FMVIPWND_H
#define FMVIPWND_H
#include <QDialog>
......@@ -31,6 +31,8 @@ private:
protected:
bool _isBusy;
Session *_session;
void keyPressEvent(QKeyEvent *e);
#ifdef Q_OS_WIN
protected:
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment