revamp and improve some code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4214 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-09-19 13:27:06 +00:00
parent ca426d5fe2
commit d0d79ecf2d
12 changed files with 275 additions and 378 deletions

View File

@@ -20,6 +20,7 @@
#include <QMouseEvent>
DVEventInterface::DVEventInterface(DiagramView *dv) :
QObject(dv),
m_dv(dv),
m_diagram(dv->diagram()),
m_running(false),
@@ -57,14 +58,18 @@ bool DVEventInterface::wheelEvent(QWheelEvent *event) {
/**
* @brief DVEventInterface::keyPressEvent
* By default, press escape key abort the curent action
* By default, press escape key abort the curent action.
* isFinish return true, and emit finish
* @param event
* @return
*/
bool DVEventInterface::keyPressEvent(QKeyEvent *event) {
if (event->key() == Qt::Key_Escape) {
bool DVEventInterface::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Escape)
{
m_running = false;
m_abort = true;
emit finish();
return true;
}
return false;