-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <ModuleBase_ITreeNode.h>
#include <XGUI_Workshop.h>
+#include <XGUI_Displayer.h>
#include <QLayout>
#include <QLineEdit>
XGUI_DataModel* aModel = myTreedView->dataModel();
ObjectPtr aObj = aModel->object(index);
if (aObj.get() != NULL) {
- aEditor->setText(aObj->data()->name().c_str());
+ aEditor->setText(QString::fromStdWString(aObj->data()->name()));
return;
}
}
if (XGUI_Tools::canRename(aObj, aName)) {
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->startOperation("Rename");
- aObj->data()->setName(qPrintable(aName));
+ aObj->data()->setName(aName.toStdWString());
aMgr->finishOperation();
}
}
update(aModel->index(i, 1, aParent));
update(aModel->index(i, 2, aParent));
}
+ XGUI_ObjectsBrowser* aObjBrowser = qobject_cast<XGUI_ObjectsBrowser*>(parent());
+ aObjBrowser->workshop()->displayer()->updateViewer();
}
void XGUI_DataTree::processEyeClick(const QModelIndex& theIndex)
// Update list of selected objects because this event happens after
// selection event in object browser
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ update(theIndex);
if (aObjBrowser) {
aObjBrowser->onSelectionChanged();
}
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
- update(theIndex);
}
}
}
//***************************************************
-void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected,
- const QItemSelection& theDeselected)
+void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& /*theSelected*/,
+ const QItemSelection& /*theDeselected*/)
{
onSelectionChanged();
}