code: def create_window(self):
          
          self.undocked_window = window = PluginWindow(self)
          window.setAttribute(Qt.WA_DeleteOnClose)
          icon = self.get_plugin_icon()
          if is_text_string(icon):
              icon = self.get_icon(icon)
          window.setWindowIcon(icon)
          window.setWindowTitle(self.get_plugin_title())
          window.setCentralWidget(self)
          window.resize(self.size())
          self.refresh_plugin()
  
          self.dockwidget.setFloating(False)
          self.dockwidget.setVisible(False)
  
          window.show()
docs: Create a QMainWindow instance containing this plugin.