Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt hide minimize, maximize and close buttons

Do you know how to hide minimize, maximize and close buttons of title bar in Qt. I especially need to hide it on QMainWindow.

like image 553
ufukgun Avatar asked Jul 09 '10 09:07

ufukgun


People also ask

How do you remove minimize and maximize button in Qt?

To turn off the Maximize Button on the default windows, set the max size of your Window on your Ui file. You will notice the Maximize button is greyed out when you run your program.

What is the name of minimize maximize and close buttons?

What is the collective name given to Minimize, Maximize and close buttons of a window? → Minimize and Maximize buttons are also called Control Buttons appear at the top right corner of any Application window or Word.


2 Answers

Set this window flags Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint

Note, that on some platforms it behaves in different way. For example on Mac OS X it Disables, (not hides) close/minimize/maximize buttons

like image 69
Kamil Klimek Avatar answered Sep 20 '22 17:09

Kamil Klimek


If you are using Qt qml then, to remove minimize, maximize and close button, set the frameless window flag in the window function in your main.qml file, like below:

flags: Qt.FramelessWindowHint
like image 29
ams Avatar answered Sep 18 '22 17:09

ams