Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QT QMainWindow fullscreen without borders

How to do a fullscreen without borders using QMainWindow ? I got a fullscreen including window borders all around the screen. I would like to have a "real" fullscreen like video games. Not a windowed fullscreen.

I tried:

MainWindow mainWindow;
mainWindow.setWindowState(Qt::WindowFullScreen);
mainWindow.showFullScreen();

MainWindow extend of QMainWindow.

like image 221
Erwan Douaille Avatar asked Mar 13 '26 17:03

Erwan Douaille


1 Answers

You want to setWindowFlags, with Qt::FramelessWindowHint and Qt::CustomizeWindowHint. So mainWindow->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint) should work for you.

like image 128
Nicholas Smith Avatar answered Mar 15 '26 05:03

Nicholas Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!