winston2020
11th February 2009, 20:39
I've got a Phonon::VideoPlayer which I've subclassed and reimplemented VideoPlayer::mouseDoubleClickEvent. I'm trying to have it enter fullscreen when double clicked, and exit when double clicked. So far, it will enter fullscreen, but then double click doesn't work.
VideoWindow.h
#pragma once
#include <QtGui>
#include <Phonon>
class VideoWindow : public Phonon::VideoPlayer
{
Q_OBJECT
public:
VideoWindow(Phonon::Category category, QWidget * parent = 0);
protected:
void mouseDoubleClickEvent( QMouseEvent *evt );
};
VideoWindow.cpp
#include "VideoWindow.h"
VideoWindow::VideoWindow(Phonon::Category category, QWidget *parent)
: VideoPlayer(category, parent)
{
}
void VideoWindow::mouseDoubleClickEvent( QMouseEvent *evt )
{
this->videoWidget()->setFullScreen(
!this->videoWidget()->isFullScreen() );
evt->accept();
}
VideoWindow.h
#pragma once
#include <QtGui>
#include <Phonon>
class VideoWindow : public Phonon::VideoPlayer
{
Q_OBJECT
public:
VideoWindow(Phonon::Category category, QWidget * parent = 0);
protected:
void mouseDoubleClickEvent( QMouseEvent *evt );
};
VideoWindow.cpp
#include "VideoWindow.h"
VideoWindow::VideoWindow(Phonon::Category category, QWidget *parent)
: VideoPlayer(category, parent)
{
}
void VideoWindow::mouseDoubleClickEvent( QMouseEvent *evt )
{
this->videoWidget()->setFullScreen(
!this->videoWidget()->isFullScreen() );
evt->accept();
}