def slotWidgetCopy(self): """Copy selected widget to the clipboard.""" if self.selwidgets: mimedata = document.generateWidgetsMime(self.selwidgets) clipboard = qt4.QApplication.clipboard() clipboard.setMimeData(mimedata)
def mimeData(self, indexes): """Get mime data for indexes.""" widgets = [idx.internalPointer() for idx in indexes] return document.generateWidgetsMime(widgets)