Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-54906

Windows: A problem with QVideoWidget:: fullScreen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.2
    • 5.6.0
    • Multimedia, Widgets: Layout
    • None
    • Win 7
    • 4f3b5fab382a14d93a5712252312c56715b9aad3 (qtbase/5.6, 25.8.2016, 5.6.2)

    Description

      When setFullScreen(true) QVideoWidget does not fill the entire screen.

      The problem occurs if QVideoWidget is the central widget.
      Also, if placed on a layout's with setContentsMargins.

      Examples:

      
      class VideoWidget: public QVideoWidget {
         Q_OBJECT
      
      public:
          VideoWidget() : QVideoWidget() {
              setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
              auto p = palette();
              p.setColor(QPalette::Window, Qt::black);
              setPalette(p);
              setAttribute(Qt::WA_OpaquePaintEvent);
      
              auto player = new QMediaPlayer();
              player->setVideoOutput(this);
              player->setMedia(QUrl("video.mp4"));
              player->play();
          }
      
          void keyPressEvent(QKeyEvent* event) {
              if (event->key() == Qt::Key_Escape && isFullScreen()) {
                  setFullScreen(false);
                  event->accept();
              } else {
                  QVideoWidget::keyPressEvent(event);
              }
          }
      
          void mouseDoubleClickEvent(QMouseEvent* event) {
              setFullScreen(!isFullScreen());
              event->accept();
          }
      };
      
      QWidget w;
      auto layout = new QVBoxLayout();
      layout->setContentsMargins(0, 0, 0, 0);
      layout->addWidget(new VideoWidget());
      w.setLayout(layout);
      w.show();
      
      QMainWindow mw;
      mw.setCentralWidget(new VideoWidget());
      mw.show();
      

      Attachments

        1. qt5_player_fullscreen_examples.zip
          2 kB
        2. qtbug54906_diag.diff
          8 kB
        3. qtbug54906_simple_log.txt
          4 kB
        4. qtbug54906_simple.zip
          3 kB
        5. qtbug54906.zip
          2 kB
        6. screenshot.jpg
          screenshot.jpg
          128 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            gil9red Ilya Petrash
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes