Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QDockWidget without a title bar

Tags:

c++

qt

I want to delete the title bar of QDockWidget completely. Is there any method to do this except the stylesheet?

like image 952
fatma.ekici Avatar asked Sep 20 '13 13:09

fatma.ekici


2 Answers

dockWidget->setTitleBarWidget(new QWidget());
like image 132
CyberZHG Avatar answered Oct 03 '22 00:10

CyberZHG


To disable window decorations (title) you have to set several flags in widget constructor, like this:

drawer::drawer(QWidget *parent) :
    QDockWidget(parent, Qt::Window | Qt::WindowStaysOnTopHint |
        Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint) /**/
{}

This disabled title and removes window from taskbar. For more information use Window Flags

like image 38
Oleg Olivson Avatar answered Oct 03 '22 01:10

Oleg Olivson