X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ListModel.cxx;h=b112dd34a5c3d2261b47df452e377369f3654e54;hb=a53349567d67f4df0ef737798a25c24d9dc8f08e;hp=8c1cb7208e2660b4b08a192b88fa450f345f0549;hpb=439579ec24edd8b147cab07f688d446d59029a1e;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ListModel.cxx b/src/HYDROGUI/HYDROGUI_ListModel.cxx index 8c1cb720..b112dd34 100644 --- a/src/HYDROGUI/HYDROGUI_ListModel.cxx +++ b/src/HYDROGUI/HYDROGUI_ListModel.cxx @@ -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& theItems, void HYDROGUI_ListModel::setDecorationEnabled( const bool theIsToEnable ) { myIsDecorationEnabled = theIsToEnable; -} \ No newline at end of file +} + +void HYDROGUI_ListModel::undoLastMove() +{ + myObjects = myPrevObjects; + reset(); +}