Important: Please read the Qt Code of Conduct -

fullscreen button for particular widget

  • Hello!! I am trying to create a media player using Qt.I want to place a button for fullscreen mode.When I use the below code fullscreen works perfectly.


    But I want to show only video widget like in the case of Vlc player.When I change my code to


    the above code no error occurs but its not working at all(assuming I have a widget named 'video').So,how can I create a pushbutton for maximizing a particular widget only.(In my case video widget)?Thanks!

  • Lifetime Qt Champion


    Any chance that ui-video is inside a layout ?

  • Moderators

    You can only make windows fullscreen, so you need to first make your widget a window:


    and to go back make it a widget again:


  • @SGaist yeah it's inside a horizontal layout.

Log in to reply