~ubuntu-branches/ubuntu/oneiric/minitube/oneiric

« back to all changes in this revision

Viewing changes to src/videowidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2010-01-24 23:02:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100124230202-hdylviu17kh07u56
Tags: upstream-0.9
ImportĀ upstreamĀ versionĀ 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "videowidget.h"
 
2
 
 
3
VideoWidget::VideoWidget(QWidget *parent) : Phonon::VideoWidget(parent) {
 
4
    // mouse autohide
 
5
    setMouseTracking(true);
 
6
    mouseTimer = new QTimer(this);
 
7
    mouseTimer->setInterval(3000);
 
8
    mouseTimer->setSingleShot(true);
 
9
    connect(mouseTimer, SIGNAL(timeout()), SLOT(hideMouse()));
 
10
}
 
11
 
 
12
void VideoWidget::mouseMoveEvent(QMouseEvent *event) {
 
13
    Phonon::VideoWidget::mouseMoveEvent(event);
 
14
 
 
15
    // qDebug() << "VideoWidget::mouseMoveEvent" << event->pos();
 
16
 
 
17
    // show the normal cursor
 
18
    unsetCursor();
 
19
 
 
20
    // then hide it again after a few seconds
 
21
    mouseTimer->start();
 
22
}
 
23
 
 
24
void VideoWidget::hideMouse() {
 
25
    // qDebug() << "hideMouse()";
 
26
    setCursor(Qt::BlankCursor);
 
27
}