def create_dock(title, parent, stretch=True):
 dock = QtWidgets.QDockWidget(parent)
 dock.setWindowTitle(title)
 dock.setObjectName(title)
 titlebar = DockTitleBarWidget(dock, title, stretch=stretch)
 dock.setTitleBarWidget(titlebar)
 dock.setAutoFillBackground(True)
 if hasattr(parent, u'dockwidgets'):
  parent.dockwidgets.append(dock)
 return dock

def create_dock ( title , parent , stretch = True ) : dock = QtWidgets . QDockWidget ( parent ) dock . setWindowTitle ( title ) dock . setObjectName ( title ) titlebar = DockTitleBarWidget ( dock , title , stretch = stretch ) dock . setTitleBarWidget ( titlebar ) dock . setAutoFillBackground ( True ) if hasattr ( parent , u'dockwidgets' ) : parent . dockwidgets . append ( dock ) return dock
create a dock widget and set it up accordingly .