diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-10-07 16:20:58 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-10-09 06:50:55 (GMT) |
commit | 23cbcae5c847342d69e593cae5406ce8344b7030 (patch) | |
tree | 8365d97df46b12dceb153d75542ee0d57cbd72c1 /src/3rdparty/phonon | |
parent | 252c3f9800444fc0e8f011ab0bf245d413acdb4d (diff) | |
download | Qt-23cbcae5c847342d69e593cae5406ce8344b7030.zip Qt-23cbcae5c847342d69e593cae5406ce8344b7030.tar.gz Qt-23cbcae5c847342d69e593cae5406ce8344b7030.tar.bz2 |
Refactored event-handling code in video widget
Moved common code into videoOutputRegionChanged()
Reviewed-by: Frans Englich
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.cpp | 25 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.h | 3 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 041b0a8..691c144 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -64,7 +64,7 @@ MMF::VideoOutput::VideoOutput(QWidget* parent) qt_widget_private(this)->extraData()->disableBlit = true; dump(); - + TRACE_EXIT_0(); } @@ -123,9 +123,7 @@ void MMF::VideoOutput::paintEvent(QPaintEvent* event) TRACE("regions %d", event->region().numRects()); TRACE("type %d", event->type()); - dump(); - - // Do not paint anything + // Do nothing } void MMF::VideoOutput::resizeEvent(QResizeEvent* event) @@ -135,10 +133,7 @@ void MMF::VideoOutput::resizeEvent(QResizeEvent* event) event->oldSize().width(), event->oldSize().height(), event->size().width(), event->size().height()); - QWidget::resizeEvent(event); - - if (m_observer) - m_observer->videoOutputRegionChanged(); + videoOutputRegionChanged(); } void MMF::VideoOutput::moveEvent(QMoveEvent* event) @@ -148,10 +143,9 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event) event->oldPos().x(), event->oldPos().y(), event->pos().x(), event->pos().y()); - QWidget::moveEvent(event); + videoOutputRegionChanged(); +} - if (m_observer) - m_observer->videoOutputRegionChanged(); } @@ -159,7 +153,14 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event) // Private functions //----------------------------------------------------------------------------- -void VideoOutput::dump() const +void MMF::VideoOutput::videoOutputRegionChanged() +{ + dump(); + if (m_observer) + m_observer->videoOutputRegionChanged(); +} + +void MMF::VideoOutput::dump() const { #ifdef _DEBUG TRACE_CONTEXT(VideoOutput::dump, EVideoInternal); diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h index 639a5ed..3e58509 100644 --- a/src/3rdparty/phonon/mmf/videooutput.h +++ b/src/3rdparty/phonon/mmf/videooutput.h @@ -52,7 +52,8 @@ protected: private: void dump() const; - + void videoOutputRegionChanged(); + private: QSize m_frameSize; |