[qet] [2692] update folio report when move diagram position

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


Revision: 2692
Author:   blacksun
Date:     2014-01-01 17:28:19 +0100 (Wed, 01 Jan 2014)
Log Message:
-----------
update folio report when move diagram position

Modified Paths:
--------------
    trunk/sources/diagram.cpp
    trunk/sources/elementprovider.cpp
    trunk/sources/elementprovider.h
    trunk/sources/qetgraphicsitem/element.h
    trunk/sources/qetgraphicsitem/reportelement.cpp
    trunk/sources/qetgraphicsitem/reportelement.h
    trunk/sources/ui/folioreportproperties.cpp
    trunk/sources/ui/folioreportproperties.ui

Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/diagram.cpp	2014-01-01 16:28:19 UTC (rev 2692)
@@ -767,7 +767,7 @@
 	if (!element || isReadOnly()) return;
 	
 	// remove all links of element
-	element->unLinkAllElements();
+	element->unlinkAllElements();
 	// enleve l'element au schema
 	removeItem(element);
 	

Modified: trunk/sources/elementprovider.cpp
===================================================================
--- trunk/sources/elementprovider.cpp	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/elementprovider.cpp	2014-01-01 16:28:19 UTC (rev 2692)
@@ -38,7 +38,7 @@
  * (You can find all filter with the #define in Element.h)
  * @return
  */
-QList <Element *> ElementProvider::FreeElement(const int filter) const{
+QList <Element *> ElementProvider::freeElement(const int filter) const{
 	QList <Element *> free_elmt;
 
 	//serch in all diagram

Modified: trunk/sources/elementprovider.h
===================================================================
--- trunk/sources/elementprovider.h	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/elementprovider.h	2014-01-01 16:28:19 UTC (rev 2692)
@@ -32,7 +32,7 @@
 {
 	public:
 	ElementProvider(QETProject *prj, Diagram *diagram=0);
-	QList <Element *> FreeElement(const int filter) const;
+	QList <Element *> freeElement(const int filter) const;
 	QList <Element *> fromUuids(QList <QUuid>) const;
 
 	private:

Modified: trunk/sources/qetgraphicsitem/element.h
===================================================================
--- trunk/sources/qetgraphicsitem/element.h	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/qetgraphicsitem/element.h	2014-01-01 16:28:19 UTC (rev 2692)
@@ -89,7 +89,7 @@
 	// related method for link between element
 	bool isFree () const;
 	virtual void linkToElement(Element *) {}
-	virtual void unLinkAllElements() {}
+	virtual void unlinkAllElements() {}
 	void initLink(QETProject *);
 	QList<Element *> linkedElements () const;
 

Modified: trunk/sources/qetgraphicsitem/reportelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.cpp	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp	2014-01-01 16:28:19 UTC (rev 2692)
@@ -18,6 +18,7 @@
 #include "reportelement.h"
 #include "elementtextitem.h"
 #include "diagramposition.h"
+#include "qetproject.h"
 
 ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qgi, Diagram *s, int *state) :
 	CustomElement(location, qgi, s, state)
@@ -25,6 +26,10 @@
 	texts().at(0)->setNoEditable();
 }
 
+ReportElement::~ReportElement() {
+	unlinkAllElements();
+}
+
 /**
  * @brief ReportElement::linkToElement
  * Link this element to the other element
@@ -40,9 +45,10 @@
 
 	//ensure elmt is a report
 	if (elmt->linkType() == Report && i) {
-		unLinkAllElements();
+		unlinkAllElements();
 		connected_elements << elmt;
 		connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(updateLabel()));
+		connect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
 		updateLabel();
 		tmp_uuids_link.removeAll(elmt->uuid());
 		elmt->linkToElement(this);
@@ -53,18 +59,19 @@
  * @brief ReportElement::unLinkAllElements
  * Unlink all of the element in the QList connected_elements
  */
-void ReportElement::unLinkAllElements(){
+void ReportElement::unlinkAllElements(){
 	if (!isFree()){
 		QList <Element *> tmp_elmt = connected_elements;
 
 		foreach(Element *elmt, connected_elements) {
 			disconnect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(updateLabel()));
+			disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
 		}
 		connected_elements.clear();
 		updateLabel();
 
 		foreach(Element *elmt, tmp_elmt){
-			elmt->unLinkAllElements();
+			elmt->unlinkAllElements();
 		}
 	}
 }

Modified: trunk/sources/qetgraphicsitem/reportelement.h
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.h	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/qetgraphicsitem/reportelement.h	2014-01-01 16:28:19 UTC (rev 2692)
@@ -31,8 +31,9 @@
 
 	public  :
 	explicit ReportElement(const ElementsLocation &, QGraphicsItem * = 0, Diagram * = 0, int * = 0);
+	~ReportElement();
 	virtual void linkToElement(Element *);
-	virtual void unLinkAllElements();
+	virtual void unlinkAllElements();
 	virtual int linkType() const;
 
 	private:

Modified: trunk/sources/ui/folioreportproperties.cpp
===================================================================
--- trunk/sources/ui/folioreportproperties.cpp	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/ui/folioreportproperties.cpp	2014-01-01 16:28:19 UTC (rev 2692)
@@ -37,7 +37,7 @@
  */
 void FolioReportProperties::BuildRadioList() {
 	ElementProvider ep(element_->diagram()->project(), element_->diagram());
-	QList <Element *> elmt_list = ep.FreeElement(Element::Report);
+	QList <Element *> elmt_list = ep.freeElement(Element::Report);
 
 	foreach (Element *elmt, elmt_list) {
 		if (elmt != element_) {

Modified: trunk/sources/ui/folioreportproperties.ui
===================================================================
--- trunk/sources/ui/folioreportproperties.ui	2014-01-01 12:02:50 UTC (rev 2691)
+++ trunk/sources/ui/folioreportproperties.ui	2014-01-01 16:28:19 UTC (rev 2692)
@@ -15,7 +15,7 @@
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout">
    <item>
-    <layout class="QVBoxLayout" name="verticalLayout">
+    <layout class="QHBoxLayout" name="main_H_layout">
      <item>
       <widget class="QGroupBox" name="Report_gb">
        <property name="toolTip">


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