Results 1 to 7 of 7

Thread: STB Video Playback

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: STB Video Playback

    I tried to achieve this using QLabel and re-implementing the resizeEvent:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. class MaskedLabel : public QLabel
    4. {
    5. protected:
    6. void resizeEvent(QResizeEvent* event)
    7. {
    8. QLabel::resizeEvent(event);
    9.  
    10. QPixmap pixmap(size());
    11. pixmap.fill(Qt::transparent);
    12. QPainter::setRedirected(this, &pixmap);
    13. QPaintEvent pe(rect());
    14. paintEvent(&pe);
    15. QPainter::restoreRedirected(this);
    16. setMask(pixmap.mask());
    17. }
    18. };
    19.  
    20. int main(int argc, char* argv[])
    21. {
    22. QApplication a(argc, argv);
    23. QLabel* label = new MaskedLabel();
    24. label->setText("Qt Centre!");
    25. QFont font = label->font();
    26. font.setPointSize(72);
    27. label->setFont(font);
    28. label->show();
    29. return a.exec();
    30. }
    To copy to clipboard, switch view to plain text mode 

    We placed this MaskedLabel over the QWebView widget and tts showing us the video playing in the background but when I tried to resize the QLabel using setGeometry() method its not showing me video on full QLabel but to some parts.
    NOTE: when I just moved the QLabel (not changing width and height) using setGeometry(), I can still see the video in background. The video vanished only when I try to resize it.

    Why resizing remove the video and show transparent QLabel?
    Last edited by high_flyer; 19th July 2011 at 11:44. Reason: code tags

Similar Threads

  1. How to playback a IP cam?
    By rayner in forum General Programming
    Replies: 3
    Last Post: 6th December 2010, 21:52
  2. Playback video on QT Widget
    By Ratheendrans in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 1st June 2010, 13:44
  3. 4.5 + video playback on windows
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2009, 09:58
  4. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 08:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.