From 0bbc7c7c741c94c99cb14dcf4492fc2ea5b986eb Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 10 Dec 2008 17:58:32 +0900 Subject: [PATCH] text over images, pass current widget when adding picture --- ankiqt/ui/facteditor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index be721ab31..175576254 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -569,13 +569,13 @@ class FactEdit(QTextEdit): self.parent = parent def insertFromMimeData(self, source): - if source.hasImage(): + if source.hasText(): + self.insertPlainText(source.text()) + elif source.hasImage(): im = QImage(source.imageData()) (fd, name) = tempfile.mkstemp(suffix=".jpg") im.save(name, None, 95) - self.parent._addPicture(name) - elif source.hasText(): - self.insertPlainText(source.text()) + self.parent._addPicture(name, widget=self) elif source.hasHtml(): self.insertHtml(self.simplifyHTML(unicode(source.html())))