title: QDockWidget hide title bar
body: <p>I can't find how to hide the title bar of my Qdockwidgets :</p>
  
  <p>I have found this on the references : </p>
  
  <pre><code>QDockWidget.setTitleBarWidget (self, QWidget widget)
  
  The widget argument has it's ownership transferred to Qt.
  
  Sets an arbitrary widget as the dock widget's title bar. If widget is 0, any custom title bar widget previously set on the dock widget is removed, but not deleted, and the default title bar will be used instead.
  </code></pre>
  
  <p>And this in quite a few places :</p>
  
  <pre><code>dockWidget-&gt;setTitleBarWidget(new QWidget());
  </code></pre>
  
  <p>but how to actually use them ? I simply can't find any simple example of code showing those in action not even in the references and all of my tries ended up with various errors. 
  In the whole page : <a href="http://pyqt.sourceforge.net/Docs/PyQt4/qdockwidget.html#setTitleBarWidget" rel="nofollow">http://pyqt.sourceforge.net/Docs/PyQt4/qdockwidget.html#setTitleBarWidget</a> there is simply nothing which tell me how I can use this :</p>
  
  <pre><code>QDockWidget.setTitleBarWidget (self, QWidget widget)
  </code></pre>
  
  <p>If I read the documentation I should replace the "widget" one by a 0 so I get no title bar displayed</p>
  
  <pre><code>self.dockWdg1.setTitleBarWidget(self, QtGui.QWidget(0))# If I don't add QtGui in front of QWidget it don't know what is QWidget 
  </code></pre>
  
  <p>give me this error :</p>
  
  <pre><code>TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0): argument 1 has unexpected type 'int'
  </code></pre>
  
  <p>Another question, is there actually people using this references : ? <a href="http://pyqt.sourceforge.net/Docs/PyQt4/qdockwidget.html#setTitleBarWidget" rel="nofollow">http://pyqt.sourceforge.net/Docs/PyQt4/qdockwidget.html#setTitleBarWidget</a></p>
  
  <p>My question can seem weird but I find thoses references so incomplete (no code example) and the explanations so obscures I really wonder if I am looking on the right one, especially when on the other side we have this : <a href="http://srinikom.github.io/pyside-docs/PySide/QtGui/QDockWidget.html#PySide.QtGui.QDockWidget" rel="nofollow">http://srinikom.github.io/pyside-docs/PySide/QtGui/QDockWidget.html#PySide.QtGui.QDockWidget</a> with pySide which seems so so so so so much better. PyQT references succeed in being even worst than MaxScript references which is not a little thing to do.  </p>
  
  <p>My complete code :</p>
  
  <pre><code>import sys, random
  from PyQt4 import QtCore, QtGui
  from PyQt4.QtGui import QPalette, QBrush, QPixmap
  
  
  
  
  
  class MainWin(QtGui.QMainWindow):
  
       def __init__(self):
          super(MainWin, self).__init__()
  
          self.initUI()
  
  
       def initUI(self):
  
  
          #central widget
          self.theboard = Board(self)
          self.setCentralWidget(self.theboard)
  
  
            #dock1 Left Dock
          self.dockWdg1 = LeftDock(self)
          #Use SizeQWidget()  to define the initial size of QDockWidget
          self.content1 = SizeQWidget()
          self.dockWdg1.setWidget(self.content1)
          self.dockWdg1.setFeatures(self.dockWdg1.NoDockWidgetFeatures)
          self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.dockWdg1)
          self.dockWdg1.setTitleBarWidget(self, QtGui.QWidget(0))# If I don't add QtGui in front of QWidget it don't know what is QWidget
  
          self.resize(360, 760)
          self.setWindowTitle('Test')
          self.show()
  
  
  
  class LeftDock(QtGui.QDockWidget):
  
      def __init__(self, parent):
          super(LeftDock, self).__init__(parent)
          self.initLeftDock()
  
  
      def initLeftDock(self):
  
          self.setGeometry(300, 300, 200, 120)
          #self.setWindowTitle('LeftDock')
  
  
  
  
  class Board(QtGui.QFrame):
  
  
      def __init__(self, parent):
          super(Board, self).__init__(parent)
  
          self.initBoard()
  
      def initBoard(self):
  
          print("ddd")
  
  
  #Dummy QWidget used by QDockWidget for defining initial size.
  class SizeQWidget(QtGui.QWidget):
         def sizeHint(self):
          return QtCore.QSize(100, 75)
  
  
  
  def main():
  
      app = QtGui.QApplication([])
      mw = MainWin()
      sys.exit(app.exec_())
  
  
  if __name__ == '__main__':
      main()
  </code></pre>