diff options
author | GiWoong Kim <giwoong.kim@samsung.com> | 2016-01-26 14:51:08 +0900 |
---|---|---|
committer | SeokYeon Hwang <syeon.hwang@samsung.com> | 2016-01-27 16:36:58 +0900 |
commit | 51d56721e5de6c0f22533348ab27b92c3313c14d (patch) | |
tree | 81275933b6891afeaa3398f20d0e140ba95317ff /tizen/src/ui | |
parent | 8ceb9a92e47b1fba3bb0fd082429dddad7232c6b (diff) | |
download | qemu-51d56721e5de6c0f22533348ab27b92c3313c14d.tar.gz qemu-51d56721e5de6c0f22533348ab27b92c3313c14d.tar.bz2 qemu-51d56721e5de6c0f22533348ab27b92c3313c14d.zip |
display: no need to consider multi-touch drawing when mouse enabled
Change-Id: I1dd6cdd16155249be4a3376904e98a496b317cc5
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
Diffstat (limited to 'tizen/src/ui')
-rw-r--r-- | tizen/src/ui/displayswwidget.cpp | 31 | ||||
-rw-r--r-- | tizen/src/ui/displayswwidget.h | 2 |
2 files changed, 21 insertions, 12 deletions
diff --git a/tizen/src/ui/displayswwidget.cpp b/tizen/src/ui/displayswwidget.cpp index c5b1fb8fae..114dbed4c4 100644 --- a/tizen/src/ui/displayswwidget.cpp +++ b/tizen/src/ui/displayswwidget.cpp @@ -40,8 +40,6 @@ DisplaySWWidget::DisplaySWWidget(QWidget *parent, DisplayType *displayForm, QSize resolution, qreal scaleFactor) : QLabel(parent), DisplayBase(displayForm, resolution, scaleFactor, this) { - this->mtTracker = getTouchScreenHelper()->getMtTracker(); - /* fill the screen with black surface */ QPixmap initImage( displayForm->getRect().width() * scaleFactor, @@ -50,18 +48,14 @@ DisplaySWWidget::DisplaySWWidget(QWidget *parent, setPixmap(initImage); } -/* override */ -void DisplaySWWidget::paintEvent(QPaintEvent *event) +void DisplaySWWidget::drawMtPoints(QPainter &painter) { - QLabel::paintEvent(event); - handlePaint(event); - - /* draw multi-touch points */ - QPainter painter(this); - + MultiTouchTracker *mtTracker = getTouchScreenHelper()->getMtTracker(); QList<TouchPoint *> pointList = mtTracker->getTouchPointList(); + TouchPoint *point = NULL; + for (int i = 0; i < pointList.count(); i++) { - TouchPoint *point = pointList.at(i); + point = pointList.at(i); if (point != NULL) { painter.drawImage( point->getHostPos().x() - mtTracker->getPointRadius(), @@ -72,6 +66,19 @@ void DisplaySWWidget::paintEvent(QPaintEvent *event) } /* override */ +void DisplaySWWidget::paintEvent(QPaintEvent *event) +{ + QLabel::paintEvent(event); + handlePaint(event); + + if (isTsEnabled == true) { + /* draw multi-touch points */ + QPainter painter(this); + drawMtPoints(painter); + } +} + +/* override */ void DisplaySWWidget::resizeEvent(QResizeEvent *event) { QLabel::resizeEvent(event); @@ -113,6 +120,7 @@ void DisplaySWWidget::mouseMoveEvent(QMouseEvent *event) } } +/* override */ void DisplaySWWidget::enterEvent(QEvent *event) { handleMouseEnter(event); @@ -123,6 +131,7 @@ void DisplaySWWidget::enterEvent(QEvent *event) } } +/* override */ void DisplaySWWidget::leaveEvent(QEvent *event) { handleMouseLeave(event); diff --git a/tizen/src/ui/displayswwidget.h b/tizen/src/ui/displayswwidget.h index 26de5d9b00..2e753e2643 100644 --- a/tizen/src/ui/displayswwidget.h +++ b/tizen/src/ui/displayswwidget.h @@ -58,7 +58,7 @@ protected: void leaveEvent(QEvent *event); private: - MultiTouchTracker *mtTracker; + void drawMtPoints(QPainter &painter); }; #endif // DISPLAYSWWIDGET_H |