def copyLog(self): text = (self.textCursor().selection().toPlainText() or self.toPlainText()) if text: KApplication.clipboard().setText(text)