How to remove window border (containing minimize, maximize and close buttons) from Qt widget?

I would like to animate a widget (QPushButon) to move around the screen of my application. To do this, I create a new button and using the QPropertyAnimation class and the "geometry" property of the button, I move it from top to bottom. The problem is that the button comes with the close, minimize, maximize, etc. buttons. I do not want them to be there, nor the border that comes with the widgets. What should I do?

+5
qt button maximize
source share
1 answer

You want to use the QWidget::setWindowFlags( Qt::WindowFlags ) .

If you want to remove the maximize / minimize / close buttons, this should work for you:

setWindowFlags( Qt::CustomizeWindowHint );

Qt::CustomizeWindowHint disables all window hints by default, such as maximize, minimize, close, and title buttons.

Here is a list of all Qt::WindowFlags .

+23
source share

All Articles