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.
QWidget::showMaximized();But I want to show only video widget like in the case of Vlc player.When I change my code to
ui->video->showMaximized();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!
-
Hi,
Any chance that
ui-videois inside a layout ? -
You can only make windows fullscreen, so you need to first make your widget a window:
ui->video->setWindowFlags(Qt::Window); ui->video->showMaximized();and to go back make it a widget again:
ui->video->setWindowFlags(Qt::Widget); ui->video->show();