Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. button on top QVideoWidget
Forum Updated to NodeBB v4.3 + New Features

button on top QVideoWidget

Scheduled Pinned Locked Moved Solved Qt 6
3 Posts 2 Posters 56 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DeSGuND Offline
    DeSGuND Offline
    DeSGuN
    wrote last edited by
    #1

    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())
    
    JonBJ 1 Reply Last reply
    0
    • DeSGuND DeSGuN

      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())
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by
      #2

      @DeSGuN
      Did you read the whole of the thread there?
      FWIW per the final response, if I understand right did you try moving the powers = QPushButton("Exit", video_widget) to after the player.play(), or even perhaps adding it on a one shot timer after the player.play() has been allowed to start? Otherwise the rest of that thread explains.

      DeSGuND 1 Reply Last reply
      0
      • JonBJ JonB

        @DeSGuN
        Did you read the whole of the thread there?
        FWIW per the final response, if I understand right did you try moving the powers = QPushButton("Exit", video_widget) to after the player.play(), or even perhaps adding it on a one shot timer after the player.play() has been allowed to start? Otherwise the rest of that thread explains.

        DeSGuND Offline
        DeSGuND Offline
        DeSGuN
        wrote last edited by
        #3

        @JonB read post more once and did through qml thanks an answer

        1 Reply Last reply
        0
        • DeSGuND DeSGuN has marked this topic as solved

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved