-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWTWordTreeView.cpp
More file actions
36 lines (30 loc) · 871 Bytes
/
WTWordTreeView.cpp
File metadata and controls
36 lines (30 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* source file for WTWordTreeView class
* Original by: christian moellinger <ch.moellinger@gmail.com>
* Modified by: Chung-Yeon Lee <cylee@bi.snu.ac.kr> and Beom-Jin Lee <bjlee@bi.snu.ac.kr>
* 03/2011 - 06/2011 Project "InfoVis: Word Tree"
* 11/2013 - 12/2013 Project "InfoVis: Word Tree ++"
*/
// qt includes
#include <QMouseEvent>
// project includes
#include "WTWordTreeView.h"
WTWordTreeView::WTWordTreeView(QWidget *parent) :
QGraphicsView(parent)
{
m_bControlPressed = false;
}
void WTWordTreeView::mousePressEvent(QMouseEvent *e)
{
emit OnClicked(e->x(), e->y(), m_bControlPressed);
}
void WTWordTreeView::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Control)
m_bControlPressed = true;
}
void WTWordTreeView::keyReleaseEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Control)
m_bControlPressed = false;
}