mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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:
@@ -313,7 +313,14 @@ void DiagramView::handleTitleBlockDrop(QDropEvent *e) {
|
|||||||
*/
|
*/
|
||||||
void DiagramView::handleTextDrop(QDropEvent *e) {
|
void DiagramView::handleTextDrop(QDropEvent *e) {
|
||||||
if (scene -> isReadOnly() || (e -> mimeData() -> hasText() == false) ) return;
|
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())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user