diff options
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 |