code: def duplicate(self, parent):
          
          # only return a single singleton instance
          if self.isViewSingleton():
              return self
              
          output = type(self).createInstance(parent, self.viewWidget())
          
          # save/restore the current settings
          xdata = ElementTree.Element('data')
          self.saveXml(xdata)
          new_name = output.objectName()
          output.setObjectName(self.objectName())
          output.restoreXml(xdata)
          output.setObjectName(new_name)
          
          return output
docs: Duplicates this current view for another.  Subclass this method to 
          provide any additional duplication options.
          
          :param      parent | <QWidget>
          
          :return     <XView> | instance of this class