10

hi does anybody knows how to remove the programs title bar? (In PyQT or in Designer) my goal is i need to replace it with my own title bar.

thanks to anyone who can help me.

Katherina
  • 2,153
  • 7
  • 26
  • 34

1 Answers1

28

The title bar is managed by the window manager and not by the application. Therefore you can not modify the title bar with the Qt Designer.

You can hide the title bar with widget.setWindowFlags(QtCore.Qt.CustomizeWindowHint) or widget.setWindowFlags(QtCore.Qt.FramelessWindowHint). These and other options are described in the Qt documentation (Qt Namespace).

The Qt Window Flags Example makes them easier to understand.

This problem looks similar to yours: Qt4 custom window frames like in office 2007?

See also: How can I hide/delete the "?" help button on the "title bar" of a QT Dialog?

Community
  • 1
  • 1
phobie
  • 2,514
  • 1
  • 20
  • 21
  • Please avoid links in answers... Three of them are broken. – DrHaze Jun 25 '15 at 14:41
  • 7
    Fixed the links. Avoiding links to documentations is not a good idea. – phobie Jul 22 '15 at 07:59
  • For PyQt5, "`widget.setWindowFlags(QtCore.Qt.FramelessWindowHint)`," works. The other one, however, doesn't. – nonimportant Jun 21 '21 at 03:12
  • Both `widget.setWindowFlags(widget.windowFlags() | ~QtCore.Qt.FramelessWindowHint)` and `widget.setWindowFlags(widget.windowFlags() | ~QtCore.Qt.CustomizeWindowHint)` work fine for me. Tested with Python 3.6.9 / PyQt 5.10.1 and Py 3.8.1 / PyQt 5.14.1 on Gnome. – phobie Jun 21 '21 at 14:06