Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cas_test n°1
[modules/shaper.git]
/
src
/
XGUI
/
XGUI_ObjectsBrowser.cpp
diff --git
a/src/XGUI/XGUI_ObjectsBrowser.cpp
b/src/XGUI/XGUI_ObjectsBrowser.cpp
index df92b7e2add92a68463f4aefda658b1302265697..49ce56a3db092c88ad7db42f6c7c502dde9a3e1c 100644
(file)
--- a/
src/XGUI/XGUI_ObjectsBrowser.cpp
+++ b/
src/XGUI/XGUI_ObjectsBrowser.cpp
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-20
19
CEA/DEN, EDF R&D
+// Copyright (C) 2014-20
22
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
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-31,6
+31,7
@@
#include <ModuleBase_ITreeNode.h>
#include <XGUI_Workshop.h>
#include <ModuleBase_ITreeNode.h>
#include <XGUI_Workshop.h>
+#include <XGUI_Displayer.h>
#include <QLayout>
#include <QLineEdit>
#include <QLayout>
#include <QLineEdit>
@@
-72,7
+73,7
@@
public:
XGUI_DataModel* aModel = myTreedView->dataModel();
ObjectPtr aObj = aModel->object(index);
if (aObj.get() != NULL) {
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;
}
}
return;
}
}
@@
-93,6
+94,13
@@
XGUI_DataTree::XGUI_DataTree(QWidget* theParent)
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::ExtendedSelection);
+ // drag and drop
+ setDragEnabled(true);
+ setAcceptDrops(true);
+ viewport()->setAcceptDrops(true);
+ setDropIndicatorShown(true);
+ setDragDropMode(QAbstractItemView::InternalMove);
+
setItemDelegateForColumn(1, new XGUI_TreeViewItemDelegate(this));
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
setItemDelegateForColumn(1, new XGUI_TreeViewItemDelegate(this));
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
@@
-130,7
+138,7
@@
void XGUI_DataTree::commitData(QWidget* theEditor)
if (XGUI_Tools::canRename(aObj, aName)) {
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->startOperation("Rename");
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();
}
}
aMgr->finishOperation();
}
}
@@
-227,6
+235,8
@@
void XGUI_DataTree::processHistoryChange(const QModelIndex& theIndex)
update(aModel->index(i, 1, aParent));
update(aModel->index(i, 2, aParent));
}
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)
}
void XGUI_DataTree::processEyeClick(const QModelIndex& theIndex)
@@
-615,8
+625,8
@@
void XGUI_ObjectsBrowser::clearContent()
}
//***************************************************
}
//***************************************************
-void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection&
theSelected
,
-
const QItemSelection& theDeselected
)
+void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection&
/*theSelected*/
,
+
const QItemSelection& /*theDeselected*/
)
{
onSelectionChanged();
}
{
onSelectionChanged();
}