mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
Slave Elements now work with Master sequentials
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4600 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -759,7 +759,7 @@ QString Element::assignVariables(QString label, Element *elmt){
|
||||
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 @@ void Element::setFolioSequentialToHash(QStringList* list, QHash<QString, QString
|
||||
* @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;
|
||||
|
||||
@@ -135,7 +135,7 @@ class Element : public QetGraphicsItem {
|
||||
//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);
|
||||
@@ -188,6 +188,14 @@ class Element : public QetGraphicsItem {
|
||||
// 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 @@ class Element : public QetGraphicsItem {
|
||||
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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user