1 // Copyright (C) 2014-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Roman NIKOLAEV
22 #include "pqArraysEditorPropertyWidget.h"
23 #include "pqEditComponents.h"
26 #include <vtkPVArrayInformation.h>
27 #include <vtkPVDataInformation.h>
28 #include <vtkPVDataSetAttributesInformation.h>
29 #include <vtkSMPropertyGroup.h>
30 #include <vtkSMSourceProxy.h>
31 #include <vtkSMUncheckedPropertyHelper.h>
34 #include <QAbstractTableModel>
35 #include <QApplication>
39 #include <QHBoxLayout>
40 #include <QHeaderView>
41 #include <QPushButton>
42 #include <QSpacerItem>
44 #include <QVBoxLayout>
49 /// Table model for the components table
50 class pqComponentsModel : public QAbstractTableModel
52 typedef QAbstractTableModel Superclass;
55 typedef QPair<QString, QString> SingleComponentInfoType;
56 typedef QVector<SingleComponentInfoType> ComponentsInfoType;
59 ComponentsInfoType myComponentsInfoVector;
66 NEW_COMPONENT_NAME = 1,
69 //------------------------------------------------------------------
70 pqComponentsModel(QObject* parentObject = 0)
71 : Superclass(parentObject)
72 , myRenameSimilar(false)
76 //------------------------------------------------------------------
77 virtual ~pqComponentsModel() {}
79 void setRenameSimilar(bool IsRenameSimilar)
81 myRenameSimilar = IsRenameSimilar;
84 QHash<QString, QString> anUnique;
85 foreach (SingleComponentInfoType item, myComponentsInfoVector)
87 if (!anUnique.contains(item.first))
89 anUnique.insert(item.first, item.second);
92 bool modified = false;
93 int min = std::numeric_limits<int>::max();
94 int max = std::numeric_limits<int>::min();
95 for (int i = 0; i < myComponentsInfoVector.size(); i++)
97 if (anUnique.contains(myComponentsInfoVector[i].first) &&
98 anUnique.value(myComponentsInfoVector[i].first) != myComponentsInfoVector[i].second)
100 myComponentsInfoVector[i].second = anUnique.value(myComponentsInfoVector[i].first);
108 emit dataChanged(index(1, min), index(1, max));
113 //------------------------------------------------------------------
114 virtual Qt::ItemFlags flags(const QModelIndex& idx) const
116 Qt::ItemFlags value = Superclass::flags(idx);
119 switch (idx.column())
121 case NEW_COMPONENT_NAME:
122 return value | Qt::ItemIsEditable;
130 //------------------------------------------------------------------
131 virtual int rowCount(const QModelIndex& idx = QModelIndex()) const
133 return idx.isValid() ? 0 : myComponentsInfoVector.size();
136 //------------------------------------------------------------------
137 virtual int columnCount(const QModelIndex& idx = QModelIndex()) const
143 //------------------------------------------------------------------
144 virtual QVariant data(const QModelIndex& idx, int role = Qt::DisplayRole) const
146 if (idx.column() == COMPONENT_NAME)
150 case Qt::DisplayRole:
151 case Qt::ToolTipRole:
152 case Qt::StatusTipRole:
153 return myComponentsInfoVector[idx.row()].first;
158 else if (idx.column() == NEW_COMPONENT_NAME)
162 case Qt::DisplayRole:
164 case Qt::ToolTipRole:
165 case Qt::StatusTipRole:
166 return myComponentsInfoVector[idx.row()].second;
167 case Qt::ForegroundRole:
169 if (myComponentsInfoVector[idx.row()].second == myComponentsInfoVector[idx.row()].first)
170 return QApplication::palette().color(QPalette::Disabled, QPalette::Text);
175 if (myComponentsInfoVector[idx.row()].second == myComponentsInfoVector[idx.row()].first)
177 QFont f = QApplication::font();
189 //------------------------------------------------------------------
190 virtual bool setData(const QModelIndex& idx, const QVariant& value, int role = Qt::EditRole)
192 if (idx.column() == NEW_COMPONENT_NAME && role == Qt::EditRole)
194 QString new_name = value.toString();
195 Q_ASSERT(idx.row() < myComponentsInfoVector.size());
196 myComponentsInfoVector[idx.row()].second = new_name;
201 QString ref_name = myComponentsInfoVector[idx.row()].first;
202 for (int i = 0; i < myComponentsInfoVector.size(); i++)
204 if (myComponentsInfoVector[i].first == ref_name)
208 myComponentsInfoVector[i].second = new_name;
212 emit dataChanged(index(1, min), index(1, max));
215 return Superclass::setData(idx, value, role);
218 //------------------------------------------------------------------
219 QVariant headerData(int section, Qt::Orientation orientation, int role) const
221 if (orientation == Qt::Horizontal)
223 if (role == Qt::DisplayRole || role == Qt::ToolTipRole)
228 return role == Qt::DisplayRole ? "Origin Name" : "Origin Names of components";
229 case NEW_COMPONENT_NAME:
230 return role == Qt::DisplayRole ? "New Name" : "New Names of components";
236 return this->Superclass::headerData(section, orientation, role);
239 //------------------------------------------------------------------
240 void setComponentsInfo(const ComponentsInfoType& data)
242 emit this->beginResetModel();
243 myComponentsInfoVector = data;
244 emit this->endResetModel();
247 //------------------------------------------------------------------
248 const ComponentsInfoType& componentsInfo() const { return myComponentsInfoVector; }
251 Q_DISABLE_COPY(pqComponentsModel)
254 /// Table model for the array's table
255 class pqArraysModel : public QAbstractTableModel
257 typedef QAbstractTableModel Superclass;
262 bool copyArray; // How to porocess arrays: remane origin array or keep origin and make copy with
265 pqComponentsModel::ComponentsInfoType myComponentsInfo;
268 //------------------------------------------------------------------
269 int nbComps() const { return myComponentsInfo.size(); }
271 //------------------------------------------------------------------
272 bool isCompomentsModified() const
274 foreach (pqComponentsModel::SingleComponentInfoType item, myComponentsInfo)
276 if (item.first != item.second)
284 typedef QPair<QString, ArrayInfo> ArraysInfoItemType;
285 typedef QVector<ArraysInfoItemType> ArraysInfoType;
288 ArraysInfoType myArraysInfo;
291 //------------------------------------------------------------------
300 //------------------------------------------------------------------
301 pqArraysModel(QObject* parentObject = 0)
302 : Superclass(parentObject)
306 //------------------------------------------------------------------
307 virtual ~pqArraysModel() {}
309 //------------------------------------------------------------------
310 virtual Qt::ItemFlags flags(const QModelIndex& idx) const
312 Qt::ItemFlags value = Superclass::flags(idx);
315 switch (idx.column())
318 return value | Qt::ItemIsUserCheckable;
320 return value | Qt::ItemIsEditable;
328 //------------------------------------------------------------------
329 virtual int rowCount(const QModelIndex& idx = QModelIndex()) const
331 return idx.isValid() ? 0 : myArraysInfo.size();
334 //------------------------------------------------------------------
335 virtual int columnCount(const QModelIndex& idx = QModelIndex()) const
341 //------------------------------------------------------------------
342 virtual QVariant data(const QModelIndex& idx, int role = Qt::DisplayRole) const
344 Q_ASSERT(idx.row() < myArraysInfo.size());
345 if (idx.column() == PROCESSING)
349 case Qt::CheckStateRole:
350 return myArraysInfo[idx.row()].second.copyArray ? Qt::Checked : Qt::Unchecked;
355 else if (idx.column() == NAME)
359 case Qt::DisplayRole:
360 case Qt::ToolTipRole:
361 case Qt::StatusTipRole:
362 return myArraysInfo[idx.row()].first;
367 else if (idx.column() == NEW_NAME)
371 case Qt::DisplayRole:
373 case Qt::ToolTipRole:
374 case Qt::StatusTipRole:
375 return myArraysInfo[idx.row()].second.newName;
376 case Qt::ForegroundRole:
378 if (myArraysInfo[idx.row()].second.newName == myArraysInfo[idx.row()].first)
379 return QApplication::palette().color(QPalette::Disabled, QPalette::Text);
384 if (myArraysInfo[idx.row()].second.newName == myArraysInfo[idx.row()].first)
386 QFont f = QApplication::font();
398 //------------------------------------------------------------------
399 virtual bool setData(const QModelIndex& idx, const QVariant& value, int role = Qt::EditRole)
402 if (idx.column() == PROCESSING && role == Qt::CheckStateRole)
404 bool checkState = (value.toInt() == Qt::Checked);
405 Q_ASSERT(idx.row() < myArraysInfo.size());
406 myArraysInfo[idx.row()].second.copyArray = (bool)checkState;
407 emit dataChanged(idx, idx);
411 if (idx.column() == NEW_NAME && role == Qt::EditRole)
413 QString new_name = value.toString();
414 if (!new_name.isEmpty())
416 Q_ASSERT(idx.row() < myArraysInfo.size());
417 myArraysInfo[idx.row()].second.newName = new_name;
418 emit dataChanged(idx, idx);
422 return Superclass::setData(idx, value, role);
425 //------------------------------------------------------------------
426 QVariant headerData(int section, Qt::Orientation orientation, int role) const
428 if (orientation == Qt::Horizontal)
430 if (role == Qt::DisplayRole || role == Qt::ToolTipRole)
435 return role == Qt::DisplayRole ? "" : "Toggle to copy arrays";
437 return role == Qt::DisplayRole ? "Origin Name" : "Origin Names of arrays";
439 return role == Qt::DisplayRole ? "New Name" : "New Names of arrays";
441 return role == Qt::DisplayRole ? "Components" : "Click item to edit components";
446 else if (role == Qt::DecorationRole)
451 return QIcon(":/ArrayRenamerIcons/resources/copy_ico_16x16.png");
457 return Superclass::headerData(section, orientation, role);
460 //------------------------------------------------------------------
461 QString arrayName(const QModelIndex& idx) const
463 if (idx.isValid() && idx.row() < myArraysInfo.size())
465 return myArraysInfo[idx.row()].first;
470 //------------------------------------------------------------------
471 void setArraysInfo(const QVector<QPair<QString, ArrayInfo> >& data)
473 emit beginResetModel();
475 emit endResetModel();
478 //------------------------------------------------------------------
479 const ArraysInfoType& arraysInfo() const { return myArraysInfo; }
481 //------------------------------------------------------------------
482 ArraysInfoType& editArraysInfo() { return myArraysInfo; }
485 Q_DISABLE_COPY(pqArraysModel)
488 //-----------------------------------------------------------------------------
489 pqEditComponents::pqEditComponents(pqComponentsModel* model, QWidget* /*parent*/)
492 myComponentsModel = model;
493 setWindowTitle("Edit Components");
496 QVBoxLayout* mainLayout = new QVBoxLayout(this);
497 QGroupBox* aComps = new QGroupBox("Components", this);
498 QGroupBox* aParams = new QGroupBox("Parameters", this);
499 QGroupBox* aBtns = new QGroupBox(this);
500 mainLayout->addWidget(aComps);
501 mainLayout->addWidget(aParams);
502 mainLayout->addWidget(aBtns);
505 QVBoxLayout* aCompsLayout = new QVBoxLayout(aComps);
506 QTableView* componentsTable = new QTableView(this);
507 componentsTable->setModel(model);
508 aCompsLayout->addWidget(componentsTable);
509 componentsTable->horizontalHeader()->setSectionResizeMode(
510 pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch);
511 componentsTable->horizontalHeader()->setSectionResizeMode(
512 pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch);
515 QVBoxLayout* aParamsLayout = new QVBoxLayout(aParams);
516 myRenameAllComps = new QCheckBox("Rename all similar Components", aParams);
517 aParamsLayout->addWidget(myRenameAllComps);
520 QPushButton* anOk = new QPushButton("OK", this);
521 QPushButton* aCancel = new QPushButton("Cancel", this);
522 QSpacerItem* space = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
523 QHBoxLayout* aBtnsLayout = new QHBoxLayout(aBtns);
524 aBtnsLayout->addWidget(anOk);
525 aBtnsLayout->addItem(space);
526 aBtnsLayout->addWidget(aCancel);
529 connect(anOk, SIGNAL(clicked()), this, SLOT(accept()));
530 connect(myRenameAllComps, SIGNAL(toggled(bool)), this, SLOT(onRenameAll(bool)));
531 connect(aCancel, SIGNAL(clicked()), this, SLOT(reject()));
534 //-----------------------------------------------------------------------------
535 pqEditComponents::~pqEditComponents() {}
537 //-----------------------------------------------------------------------------
538 bool pqEditComponents::renameAllComps()
540 return myRenameAllComps->checkState() == Qt::Checked;
543 //-----------------------------------------------------------------------------
544 void pqEditComponents::onRenameAll(bool val)
546 myComponentsModel->setRenameSimilar(val);
549 //-----------------------------------------------------------------------------
550 pqArraysEditorPropertyWidget::pqArraysEditorPropertyWidget(
551 vtkSMProxy* smproxy, vtkSMPropertyGroup* smgroup, QWidget* parentObject)
552 : Superclass(smproxy, parentObject)
555 myPropertyGroup = smgroup;
556 myConnection = vtkEventQtSlotConnect::New();
559 myArraysTable = new QTableView(this);
560 myArraysModel = new pqArraysModel(this);
561 myArraysTable->setModel(myArraysModel);
564 QVBoxLayout* lay = new QVBoxLayout(this);
565 lay->addWidget(myArraysTable);
566 myArraysTable->horizontalHeader()->setSectionResizeMode(
567 pqArraysModel::PROCESSING, QHeaderView::ResizeToContents);
568 myArraysTable->horizontalHeader()->setSectionResizeMode(
569 pqArraysModel::NAME, QHeaderView::Stretch);
570 myArraysTable->horizontalHeader()->setSectionResizeMode(
571 pqArraysModel::NEW_NAME, QHeaderView::Stretch);
572 myArraysTable->horizontalHeader()->setSectionResizeMode(
573 pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents);
574 myArraysTable->resizeColumnsToContents();
577 /// Client < - > Server
579 this, "arrayInfo", SIGNAL(arraysInfoChanged()), smgroup->GetProperty("ArrayInfo"));
581 this, "componentsInfo", SIGNAL(componentsInfoChanged()), smgroup->GetProperty("ComponentInfo"));
582 myConnection->Connect(smproxy, vtkCommand::UpdateDataEvent, this, SLOT(onInputDataChanged()));
585 QObject::connect(myArraysModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this,
586 SLOT(onDataChanged(const QModelIndex&, const QModelIndex&)));
588 // Obtains list of the data arrays
592 pqArraysEditorPropertyWidget::~pqArraysEditorPropertyWidget()
594 delete myArraysModel;
595 myConnection->Delete();
598 //-----------------------------------------------------------------------------
599 void pqArraysEditorPropertyWidget::setArraysInfo(const QList<QVariant>& values)
601 pqArraysModel::ArraysInfoType vdata;
602 vdata.resize(values.size() / 3);
603 for (int cc = 0; (cc + 1) < values.size(); cc += 3)
605 vdata[cc / 3].first = values[cc].toString();
606 vdata[cc / 3].second.newName = values[cc + 1].toString();
607 vdata[cc / 3].second.copyArray = values[cc + 2].toBool();
609 myArraysModel->setArraysInfo(vdata);
612 //-----------------------------------------------------------------------------
613 QList<QVariant> pqArraysEditorPropertyWidget::arraysInfo() const
615 const pqArraysModel::ArraysInfoType& vdata = myArraysModel->arraysInfo();
616 QList<QVariant> reply;
617 for (int cc = 0; cc < vdata.size(); cc++)
619 if (vdata[cc].first != vdata[cc].second.newName)
621 reply.push_back(vdata[cc].first);
622 reply.push_back(vdata[cc].second.newName);
623 reply.push_back(vdata[cc].second.copyArray ? 1 : 0);
629 //-----------------------------------------------------------------------------
630 void pqArraysEditorPropertyWidget::setComponentsInfo(const QList<QVariant>& values)
632 pqArraysModel::ArraysInfoType& vdata = myArraysModel->editArraysInfo();
633 for (int i = 0; i < vdata.size(); i++)
635 vdata.resize(values.size() / 3);
636 QString anArrayName = "", aNewCompName = "";
638 for (int cc = 0; (cc + 1) < values.size(); cc += 3)
640 anArrayName = values[cc].toString();
641 aCompId = values[cc + 1].toInt();
642 aNewCompName = values[cc + 2].toString();
644 if (vdata[i].first == anArrayName && aCompId < vdata[i].second.myComponentsInfo.size())
646 vdata[i].second.myComponentsInfo[i].second = aNewCompName;
651 //-----------------------------------------------------------------------------
652 QList<QVariant> pqArraysEditorPropertyWidget::componentsInfo() const
654 pqArraysModel::ArraysInfoType& vdata = myArraysModel->editArraysInfo();
655 QList<QVariant> reply;
656 for (int cc = 0; cc < vdata.size(); cc++)
658 for (int ll = 0; ll < vdata[cc].second.myComponentsInfo.size(); ll++)
660 if (vdata[cc].second.myComponentsInfo[ll].second !=
661 vdata[cc].second.myComponentsInfo[ll].first)
664 (vdata[cc].first != vdata[cc].second.newName && !vdata[cc].second.newName.isEmpty())
665 ? vdata[cc].second.newName
667 reply.push_back(aArrayName);
669 reply.push_back(vdata[cc].second.myComponentsInfo[ll].second);
676 //-----------------------------------------------------------------------------
677 void pqArraysEditorPropertyWidget::onDataChanged(
678 const QModelIndex& topleft, const QModelIndex& /*btmright*/)
680 if (topleft.column() == pqArraysModel::PROCESSING || topleft.column() == pqArraysModel::NEW_NAME)
682 if (topleft.column() == pqArraysModel::PROCESSING)
684 const pqArraysModel::ArraysInfoType& vdata = myArraysModel->arraysInfo();
685 Q_ASSERT(topleft.row() < vdata.size());
686 if (vdata[topleft.row()].second.isCompomentsModified())
688 myPropertyGroup->GetProperty("ComponentInfo")->Modified();
691 emit arraysInfoChanged();
695 //-----------------------------------------------------------------------------
696 void pqArraysEditorPropertyWidget::updateArraysList()
698 vtkPVDataSetAttributesInformation *cdi = NULL, *pdi = NULL;
700 vtkSMSourceProxy* input =
701 vtkSMSourceProxy::SafeDownCast(vtkSMUncheckedPropertyHelper(proxy(), "Input").GetAsProxy(0));
707 const QVector<QPair<QString, pqArraysModel::ArrayInfo> >& oldModelData =
708 myArraysModel->arraysInfo();
710 QStringList oldNames;
711 QPair<QString, pqArraysModel::ArrayInfo> oldArrayInfo;
712 foreach (oldArrayInfo, oldModelData)
714 oldNames.append(oldArrayInfo.first);
717 myDataTime = input->GetDataInformation(0)->GetMTime();
719 pdi = input->GetDataInformation(0)->GetPointDataInformation();
720 cdi = input->GetDataInformation(0)->GetCellDataInformation();
721 QVector<QPair<QString, pqArraysModel::ArrayInfo> > myModelArraysInfo;
725 for (int i = 0; i < pdi->GetNumberOfArrays(); i++)
727 vtkPVArrayInformation* pvArrayInformation = pdi->GetArrayInformation(i);
728 QString anArrayName = QString(pvArrayInformation->GetName());
729 int numComponents = pvArrayInformation->GetNumberOfComponents();
730 int index = oldNames.indexOf(anArrayName);
734 myModelArraysInfo.push_back(qMakePair(anArrayName, pqArraysModel::ArrayInfo()));
735 myModelArraysInfo.last().second.newName = anArrayName;
736 for (int j = 0; j < numComponents; j++)
738 QString compName = pvArrayInformation->GetComponentName(j);
739 myModelArraysInfo.last().second.myComponentsInfo.insert(j, qMakePair(compName, compName));
745 myModelArraysInfo.push_back(qMakePair(anArrayName, oldModelData[index].second));
746 if (oldModelData[index].second.nbComps() != numComponents)
748 for (int j = 0; j < numComponents; j++)
750 QString compName = pvArrayInformation->GetComponentName(j);
751 myModelArraysInfo.last().second.myComponentsInfo.insert(
752 j, qMakePair(compName, compName));
760 for (int i = 0; i < cdi->GetNumberOfArrays(); i++)
763 vtkPVArrayInformation* pvArrayInformation = cdi->GetArrayInformation(i);
764 QString anArrayName = QString(pvArrayInformation->GetName());
765 int numComponents = pvArrayInformation->GetNumberOfComponents();
766 int index = oldNames.indexOf(anArrayName);
769 myModelArraysInfo.push_back(qMakePair(anArrayName, pqArraysModel::ArrayInfo()));
770 myModelArraysInfo.last().second.newName = anArrayName;
771 for (int j = 0; j < numComponents; j++)
773 QString compName = pvArrayInformation->GetComponentName(j);
774 myModelArraysInfo.last().second.myComponentsInfo.insert(j, qMakePair(compName, compName));
780 myModelArraysInfo.push_back(qMakePair(anArrayName, oldModelData[index].second));
781 if (oldModelData[index].second.nbComps() != numComponents)
783 for (int j = 0; j < numComponents; j++)
785 QString compName = pvArrayInformation->GetComponentName(j);
786 myModelArraysInfo.last().second.myComponentsInfo.insert(
787 j, qMakePair(compName, compName));
794 myArraysModel->setArraysInfo(myModelArraysInfo);
796 for (int i = 0; i < myModelArraysInfo.size(); i++)
798 if (myModelArraysInfo[i].second.nbComps() > 1)
800 QPushButton* aBtn = new QPushButton(myArraysTable);
801 aBtn->setProperty("arrayName", myModelArraysInfo[i].first);
802 aBtn->setIcon(QIcon(":/ArrayRenamerIcons/resources/edit_ico_16x16.png"));
803 myArraysTable->setIndexWidget(myArraysModel->index(i, 3), aBtn);
804 connect(aBtn, SIGNAL(clicked()), this, SLOT(onComponentsEdit()));
809 //-----------------------------------------------------------------------------
810 void pqArraysEditorPropertyWidget::onInputDataChanged()
812 vtkSMSourceProxy* input =
813 vtkSMSourceProxy::SafeDownCast(vtkSMUncheckedPropertyHelper(proxy(), "Input").GetAsProxy(0));
814 if (myDataTime < input->GetDataInformation(0)->GetMTime())
820 //-----------------------------------------------------------------------------
821 void pqArraysEditorPropertyWidget::onComponentsEdit()
823 QObject* snd = sender();
824 QVariant v = snd->property("arrayName");
829 QString anArrayName = v.toString();
830 pqComponentsModel::ComponentsInfoType* aComponents = NULL;
831 pqArraysModel::ArraysInfoType& aModelData = myArraysModel->editArraysInfo();
832 for (int i = 0; i < aModelData.size(); i++)
834 pqArraysModel::ArraysInfoItemType& item = aModelData[i];
835 if (item.first == anArrayName)
837 aComponents = &item.second.myComponentsInfo;
845 pqComponentsModel* aCompsModel = new pqComponentsModel();
846 aCompsModel->setComponentsInfo(*aComponents);
847 pqEditComponents* dlg = new pqEditComponents(aCompsModel, this);
848 if (dlg->exec() == QDialog::Accepted)
850 const pqComponentsModel::ComponentsInfoType& aRenamedComponents =
851 aCompsModel->componentsInfo();
852 if (dlg->renameAllComps())
854 /// Rename all components in all arrays
855 for (int i = 0; i < aModelData.size(); i++)
857 pqArraysModel::ArraysInfoItemType& item = aModelData[i];
858 for (int j = 0; j < item.second.myComponentsInfo.size(); j++)
860 pqComponentsModel::ComponentsInfoType& aComps = item.second.myComponentsInfo;
861 for (int k = 0; k < aRenamedComponents.size(); k++)
863 if (aComps[j].first == aRenamedComponents[k].first)
865 aComps[j].second = aRenamedComponents[k].second;
875 aModelData[index].second.myComponentsInfo = aRenamedComponents;
878 emit componentsInfoChanged();