11

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

Daud
  • 7,429
  • 18
  • 68
  • 115

1 Answers1

35

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

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

setWindowFlags( Qt::CustomizeWindowHint );

Qt::CustomizeWindowHint turns off all the default window hints, like the maximize, minimize, close buttons, and the title bar.

Here's a list of all Qt::WindowFlags.

Andris
  • 921
  • 7
  • 14
wkl
  • 77,184
  • 16
  • 165
  • 176
  • 13
    `Qt::FramelessWindowHint` might be a good option too as this removes the border too. Of course this is only an option provided the button is only to be moved programmatically and not by the user. – Troubadour Oct 16 '10 at 11:45