issue #0001649: Changing names on Pads does not change them everywere
This commit is contained in:
parent
c92dbb3269
commit
58cb2e2ddc
|
@ -122,10 +122,14 @@ void TaskMirroredParameters::setupUI()
|
|||
std::vector<App::DocumentObject*> originals = pcMirrored->Originals.getValues();
|
||||
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i)
|
||||
{
|
||||
if ((*i) != NULL)
|
||||
ui->listWidgetFeatures->addItem(QString::fromLatin1((*i)->getNameInDocument()));
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
ui->listWidgetFeatures->addItem(item);
|
||||
}
|
||||
}
|
||||
// ---------------------
|
||||
|
||||
|
@ -178,10 +182,22 @@ void TaskMirroredParameters::onSelectionChanged(const Gui::SelectionChanges& msg
|
|||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
|
||||
if (originalSelected(msg)) {
|
||||
if (selectionMode == addFeature)
|
||||
ui->listWidgetFeatures->addItem(QString::fromLatin1(msg.pObjectName));
|
||||
else
|
||||
removeItemFromListWidget(ui->listWidgetFeatures, QString::fromLatin1(msg.pObjectName));
|
||||
Gui::SelectionObject selObj(msg);
|
||||
App::DocumentObject* obj = selObj.getObject();
|
||||
Q_ASSERT(obj);
|
||||
|
||||
QString label = QString::fromUtf8(obj->Label.getValue());
|
||||
QString objectName = QString::fromLatin1(msg.pObjectName);
|
||||
|
||||
if (selectionMode == addFeature) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(label);
|
||||
item->setData(Qt::UserRole, objectName);
|
||||
ui->listWidgetFeatures->addItem(item);
|
||||
}
|
||||
else {
|
||||
removeItemFromListWidget(ui->listWidgetFeatures, label);
|
||||
}
|
||||
exitSelectionMode();
|
||||
} else {
|
||||
if ( selectionMode == reference) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
* will go out of sync, and crashes may result.
|
||||
*/
|
||||
ComboLinks(QComboBox &combo);
|
||||
ComboLinks() {_combo = 0; doc = 0;};
|
||||
ComboLinks() {_combo = 0; doc = 0;}
|
||||
void setCombo(QComboBox &combo) {assert(_combo == 0); this->_combo = &combo; _combo->clear();}
|
||||
|
||||
/**
|
||||
|
@ -97,9 +97,9 @@ public:
|
|||
*/
|
||||
int setCurrentLink(const App::PropertyLinkSub &lnk);
|
||||
|
||||
QComboBox& combo(void) const {assert(_combo); return *_combo;};
|
||||
QComboBox& combo(void) const {assert(_combo); return *_combo;}
|
||||
|
||||
~ComboLinks() {_combo = 0; clear();};
|
||||
~ComboLinks() {_combo = 0; clear();}
|
||||
private:
|
||||
QComboBox* _combo;
|
||||
App::Document* doc;
|
||||
|
|
Loading…
Reference in New Issue
Block a user