button on top QVideoWidget
-
No displayed button on top QVideoWidget. Tried it https://forum.qt.io/topic/156350/button-over-qvideowidget/4 didn't help
app = QApplication(sys.argv) window = QMainWindow() player = QMediaPlayer() player.setSource(QUrl.fromLocalFile("file/backgorund.mp4")) video_widget = QVideoWidget() player.setVideoOutput(video_widget) powers = QPushButton("Exit", video_widget) window.setCentralWidget(video_widget) player.play() window.show() sys.exit(app.exec())
-
No displayed button on top QVideoWidget. Tried it https://forum.qt.io/topic/156350/button-over-qvideowidget/4 didn't help
app = QApplication(sys.argv) window = QMainWindow() player = QMediaPlayer() player.setSource(QUrl.fromLocalFile("file/backgorund.mp4")) video_widget = QVideoWidget() player.setVideoOutput(video_widget) powers = QPushButton("Exit", video_widget) window.setCentralWidget(video_widget) player.play() window.show() sys.exit(app.exec())
@DeSGuN
Did you read the whole of the thread there?
FWIW per the final response, if I understand right did you try moving thepowers = QPushButton("Exit", video_widget)
to after theplayer.play()
, or even perhaps adding it on a one shot timer after theplayer.play()
has been allowed to start? Otherwise the rest of that thread explains. -
@DeSGuN
Did you read the whole of the thread there?
FWIW per the final response, if I understand right did you try moving thepowers = QPushButton("Exit", video_widget)
to after theplayer.play()
, or even perhaps adding it on a one shot timer after theplayer.play()
has been allowed to start? Otherwise the rest of that thread explains. -
D DeSGuN has marked this topic as solved