From: <gk...@ke...> - 2011-01-19 23:14:03
|
Module: qt-gstreamer Branch: master Commit: 64129763d290ffe8b2e5c2d2cde3f2f762100a57 URL: http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=64129763d290ffe8b2e5c2d2cde3f2f762100a57 Author: George Kiagiadakis <geo...@co...> Date: Thu Jan 20 01:11:49 2011 +0200 Paint the widget black when it has no renderer attached. --- src/QGst/Ui/videowidget.cpp | 6 ++++++ src/QGst/Ui/videowidget.h | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/QGst/Ui/videowidget.cpp b/src/QGst/Ui/videowidget.cpp index f1d93e0..c09b27c 100644 --- a/src/QGst/Ui/videowidget.cpp +++ b/src/QGst/Ui/videowidget.cpp @@ -274,5 +274,11 @@ void VideoWidget::stopPipelineWatch() } } +void VideoWidget::paintEvent(QPaintEvent *event) +{ + QPainter p(this); + p.fillRect(event->rect(), Qt::black); +} + } //namespace Ui } //namespace QGst diff --git a/src/QGst/Ui/videowidget.h b/src/QGst/Ui/videowidget.h index 6b12e82..01b2457 100644 --- a/src/QGst/Ui/videowidget.h +++ b/src/QGst/Ui/videowidget.h @@ -103,6 +103,9 @@ public: */ void stopPipelineWatch(); +protected: + virtual void paintEvent(QPaintEvent *event); + private: AbstractRenderer *d; }; |