[qet] [3419] Diagram view: reactive drag&drop html text |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3419
Author: blacksun
Date: 2014-10-30 14:29:58 +0100 (Thu, 30 Oct 2014)
Log Message:
-----------
Diagram view: reactive drag&drop html text
Modified Paths:
--------------
trunk/sources/diagramview.cpp
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2014-10-30 05:26:04 UTC (rev 3418)
+++ trunk/sources/diagramview.cpp 2014-10-30 13:29:58 UTC (rev 3419)
@@ -313,7 +313,14 @@
*/
void DiagramView::handleTextDrop(QDropEvent *e) {
if (scene -> isReadOnly() || (e -> mimeData() -> hasText() == false) ) return;
- scene -> undoStack().push(new AddItemCommand<IndependentTextItem *>(new IndependentTextItem (e -> mimeData() -> text()), scene, mapToScene(e->pos())));
+
+ IndependentTextItem *iti = new IndependentTextItem (e -> mimeData() -> text(), scene);
+
+ if (e -> mimeData() -> hasHtml()) {
+ iti -> setHtml (e -> mimeData() -> text());
+ }
+
+ scene -> undoStack().push(new AddItemCommand<IndependentTextItem *>(iti, scene, mapToScene(e->pos())));
}
/**