Salome HOME
Merge branch 'BR_MULTI_BATHS' into HEAD
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ListModel.cxx
index 8c1cb7208e2660b4b08a192b88fa450f345f0549..b112dd34a5c3d2261b47df452e377369f3654e54 100644 (file)
@@ -372,6 +372,7 @@ bool HYDROGUI_ListModel::move( const int theItem, const OpType theType,
   if ( aDestinationIndex >= 0 && aDestinationIndex < myObjects.count() ) {
     int aDestinationRow = isInsertBefore ? aDestinationIndex : aDestinationIndex + 1;
     if ( beginMoveRows( QModelIndex(), theItem, theItem, QModelIndex(), aDestinationRow ) ) {
+      myPrevObjects = myObjects;
       myObjects.move( theItem, aDestinationIndex );
       endMoveRows();
       aRes = true;
@@ -487,4 +488,10 @@ bool HYDROGUI_ListModel::isDragAndDropAllowed( const QList<int>& theItems,
 void HYDROGUI_ListModel::setDecorationEnabled( const bool theIsToEnable )
 {
   myIsDecorationEnabled = theIsToEnable;
-}
\ No newline at end of file
+}
+
+void HYDROGUI_ListModel::undoLastMove()
+{
+  myObjects = myPrevObjects;
+  reset();
+}