[qet] [4600] Slave Elements now work with Master sequentials

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


Revision: 4600
Author:   dfochi
Date:     2016-08-02 03:35:55 +0200 (Tue, 02 Aug 2016)
Log Message:
-----------
Slave Elements now work with Master sequentials

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/element.cpp
    trunk/sources/qetgraphicsitem/element.h

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2016-07-31 01:30:42 UTC (rev 4599)
+++ trunk/sources/qetgraphicsitem/element.cpp	2016-08-02 01:35:55 UTC (rev 4600)
@@ -759,7 +759,7 @@
 	label.replace("%id", QString::number(elmt->diagram()->folioIndex()+1));
 	label.replace("%total", QString::number(elmt->diagram()->border_and_titleblock.folioTotal()));
 	label.replace("%prefix", elmt->getPrefix());
-	label = assignSeq(label);
+	label = assignSeq(label, elmt);
 	return label;
 }
 
@@ -852,27 +852,27 @@
  * @param label to be replaced
  * @return replaced label
  */
-QString Element::assignSeq(QString label) {
-	for (int i = 1; i <= qMax(qMax(qMax(seq_unitfolio.size(), seq_tenfolio.size()),qMax(seq_hundredfolio.size(),seq_unit.size())),qMax(seq_hundred.size(),seq_ten.size())); i++) {
+QString Element::assignSeq(QString label, Element* elmt) {
+	for (int i = 1; i <= qMax(qMax(qMax(elmt->seq_unitfolio.size(), elmt->seq_tenfolio.size()),qMax(elmt->seq_hundredfolio.size(),elmt->seq_unit.size())),qMax(elmt->seq_hundred.size(),elmt->seq_ten.size())); i++) {
 		// "&& !seq.isEmpty()" introduced in the methods below to avoid crash when copying and paste elements
 		// that contain folio sequential in their labels. Needs further debugging.
-		if (label.contains("%sequ_" + QString::number(i)) && !seq_unit.isEmpty()) {
-			label.replace("%sequ_" + QString::number(i),seq_unit.at(i-1));
+		if (label.contains("%sequ_" + QString::number(i)) && !elmt->seq_unit.isEmpty()) {
+			label.replace("%sequ_" + QString::number(i),elmt->seq_unit.at(i-1));
 		}
-		if (label.contains("%seqt_" + QString::number(i)) && !seq_ten.isEmpty()) {
-			label.replace("%seqt_" + QString::number(i),seq_ten.at(i-1));
+		if (label.contains("%seqt_" + QString::number(i)) && !elmt->seq_ten.isEmpty()) {
+			label.replace("%seqt_" + QString::number(i),elmt->seq_ten.at(i-1));
 		}
-		if (label.contains("%seqh_" + QString::number(i)) && !seq_hundred.isEmpty()) {
-			label.replace("%seqh_" + QString::number(i),seq_hundred.at(i-1));
+		if (label.contains("%seqh_" + QString::number(i)) && !elmt->seq_hundred.isEmpty()) {
+			label.replace("%seqh_" + QString::number(i),elmt->seq_hundred.at(i-1));
 		}
-		if (label.contains("%sequf_" + QString::number(i)) && !seq_unitfolio.isEmpty()) {
-			label.replace("%sequf_" + QString::number(i),seq_unitfolio.at(i-1));
+		if (label.contains("%sequf_" + QString::number(i)) && !elmt->seq_unitfolio.isEmpty()) {
+			label.replace("%sequf_" + QString::number(i),elmt->seq_unitfolio.at(i-1));
 		}
-		if (label.contains("%seqtf_" + QString::number(i)) && !seq_tenfolio.isEmpty()) {
-			label.replace("%seqtf_" + QString::number(i),seq_tenfolio.at(i-1));
+		if (label.contains("%seqtf_" + QString::number(i)) && !elmt->seq_tenfolio.isEmpty()) {
+			label.replace("%seqtf_" + QString::number(i),elmt->seq_tenfolio.at(i-1));
 		}
-		if (label.contains("%seqhf_" + QString::number(i)) && !seq_hundredfolio.isEmpty()) {
-			label.replace("%seqhf_" + QString::number(i),seq_hundredfolio.at(i-1));
+		if (label.contains("%seqhf_" + QString::number(i)) && !elmt->seq_hundredfolio.isEmpty()) {
+			label.replace("%seqhf_" + QString::number(i),elmt->seq_hundredfolio.at(i-1));
 		}
 	}
 	return label;

Modified: trunk/sources/qetgraphicsitem/element.h
===================================================================
--- trunk/sources/qetgraphicsitem/element.h	2016-07-31 01:30:42 UTC (rev 4599)
+++ trunk/sources/qetgraphicsitem/element.h	2016-08-02 01:35:55 UTC (rev 4600)
@@ -135,7 +135,7 @@
 																									//about the herited class like contactelement for know
 																									// kind of contact (simple tempo) or number of contact show by the element.
 		QString assignVariables (QString, Element *);
-		QString assignSeq (QString);
+		QString assignSeq (QString, Element*);
 		void setSequential ();
 		void setSequentialToList(QStringList*, NumerotationContext*, QString);
 		void setFolioSequentialToHash(QStringList*, QHash<QString, QStringList>*, QString);
@@ -184,10 +184,18 @@
 	virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
 	virtual QDomElement toXml(QDomDocument &, QHash<Terminal *, int> &) const;
 	QUuid uuid() const;
-	
+
 	// orientation-related methods
 	int orientation() const;
 	
+	// Lists containing Sequentials
+	QStringList seq_unit;
+	QStringList seq_unitfolio;
+	QStringList seq_ten;
+	QStringList seq_tenfolio;
+	QStringList seq_hundred;
+	QStringList seq_hundredfolio;
+
 	protected:
 		void drawAxes(QPainter *, const QStyleOptionGraphicsItem *);
 	
@@ -208,12 +216,6 @@
 	private:
 		bool m_mouse_over;
 		QString m_prefix;
-		QStringList seq_unit;
-		QStringList seq_unitfolio;
-		QStringList seq_ten;
-		QStringList seq_tenfolio;
-		QStringList seq_hundred;
-		QStringList seq_hundredfolio;
 
 };
 


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