Diagram view: reactive drag&drop html text

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3419 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-10-30 13:29:58 +00:00
parent 75b0d3b54f
commit 6b40932bb4

View File

@@ -313,7 +313,14 @@ void DiagramView::handleTitleBlockDrop(QDropEvent *e) {
*/
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())));
}
/**