[Resoved]How de copy and paste drawn objets
-
I'm using QGraphicsScene in which there are a graphicsview, my items are of type QGraphicsEllipseItem, QGraphicsPixmapItem, QGraphicsItemGroup, QGraphicsLineItem, QGraphicsProxyWidget, QGraphicsPolygonItem, QGraphicsRectItem, QGraphicsSimpleTextItem.
And I use the addItem() methode of the QGraphicsScene.
-
In the "GraphicsView docs":http://doc.qt.nokia.com/4.7/graphicsview.html#drag-and-drop you can find some information about drag and drop.
Have you looked in the examples?
-
I've resoved my problem. What I do is: when items are selected I serialize them and create a xml text. And I covert the QDomDecoment whitch contain the xml text to string and put the string in the clipboard.
In the method whitch process the paste I get the text in the clipboar and deserialize it.
-
hi i am a new to Qt, i couldn't find how u will serialize selected items, if you copy an selected item like which i done below i just get a shallow copy of an item, how do we actually get this selected item and serialize it. plz show it with a small example
QList<QGraphicsItem *> copiedItem = this->selectedItems();
All i want to finally do is, i wanted to copy and paste QGraphicItem on my QGraphicScene .
thanks in advance