[qet] [2395] Fix merge sources trunk to branche 0.4

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2395
Author:   scorpio810
Date:     2013-07-25 19:01:16 +0200 (Thu, 25 Jul 2013)
Log Message:
-----------
Fix merge sources trunk to branche 0.4

Modified Paths:
--------------
    branches/0.4/sources/diagramview.cpp

Modified: branches/0.4/sources/diagramview.cpp
===================================================================
--- branches/0.4/sources/diagramview.cpp	2013-07-25 09:21:46 UTC (rev 2394)
+++ branches/0.4/sources/diagramview.cpp	2013-07-25 17:01:16 UTC (rev 2395)
@@ -40,7 +40,10 @@
 #include "qtextorientationspinboxwidget.h"
 #include <QGraphicsObject>
 
+#include <QGraphicsPixmapItem>
+#include <QGraphicsSceneMouseEvent>
 
+
 /**
 	Constructeur
 	@param diagram Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise
@@ -1255,24 +1258,27 @@
 * @param pos
 * @return
 */
-IndependentTextItem *DiagramView::addDiagramImageAtPos(const QPointF &pos) {
+DiagramImageItem *DiagramView::addDiagramImageAtPos(const QPointF &pos) {
 
 	if (!isInteractive() || scene -> isReadOnly()) return(0);
-
-	addImage();
+	/*addImage();
 	QGraphicsPixmapItem *pixItem = new QGraphicsPixmapItem( QPixmap::fromImage(image_to_add_) );
-	scene ->addItem( pixItem );
-
-/*// cree un nouveau champ de texte
-IndependentTextItem *iti = new IndependentTextItem("_");
-
-// le place a la position pos en gerant l'annulation
-scene -> undoStack().push(new AddTextCommand(scene, iti, pos));
+	pixItem->setFlag(QGraphicsItem::ItemIsMovable,true);
+	pixItem->setFlag(QGraphicsItem::ItemIsSelectable,true);
+	pixItem->setCursor(Qt::PointingHandCursor);
+	scene ->addItem(pixItem);*/
+	
+// cree un nouveau champ image
+	DiagramImageItem *Imageitem = new DiagramImageItem( QPixmap::fromImage(image_to_add_) );
+	
+	// le place a la position pos en gerant l'annulation
+	//scene -> undoStack().push(new AddImageCommand(scene, Imageitem, pos));
 	adjustSceneRect();
-
-	// emet le signal textAdded
-emit(textAdded(false));
-	return(iti);*/
+	
+	// emet le signal ImageAdded
+	emit(ImageAdded(false));
+	
+	return(Imageitem);
 }
 
 /**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/