code: def __init__(self, parent, name, text):
      super().__init__(parent=parent)
      self.setObjectName(name)
      self.setAllowedAreas(
          Qt.RightDockWidgetArea | Qt.LeftDockWidgetArea
      )
      # 感觉不给关闭好点。可以在显示里面取消显示
      self.setFeatures(
          QDockWidget.DockWidgetMovable
          | QDockWidget.DockWidgetFloatable
      )
      sizePolicy = QtWidgets.QSizePolicy(
          QtWidgets.QSizePolicy.Preferred,
          QtWidgets.QSizePolicy.Preferred,
      )
      sizePolicy.setHorizontalStretch(0)
      sizePolicy.setVerticalStretch(0)
      sizePolicy.setHeightForWidth(
          self.sizePolicy().hasHeightForWidth()
      )
      self.setSizePolicy(sizePolicy)
      self.setMinimumWidth(230)
      self.setWindowTitle(text)
      self.setStyleSheet(
          "QDockWidget { background-color:rgb(204,204,248); }"
      )
      self.topLevelChanged.connect(self.changeBackColor)
  
file_path: PaddleSeg/EISeg/eiseg/widget/create.py
imports: from qtpy.QtWidgets import QDockWidget
  from qtpy import QtCore, QtGui, QtWidgets
  from qtpy.QtCore import Qt
label_desc: Use image node_id 1 to create a new DockWidget object from inherited base classes: QDockWidget with example: obj = DockWidget(parent, name, text)