Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.0
-
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
For Gerrit Dashboard: QTBUG-54906 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
166115,3 | QWidgetPrivate::setWindowFlags(): Fix checking for changes in Qt::Window | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |