File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 32
32
#include < QDomNode>
33
33
#include < QVector>
34
34
#include < QStringBuilder>
35
+ #if QT_VERSION >= 0x050900
35
36
#include < QUndoCommand>
37
+ #endif
36
38
37
39
#include " qgssettings.h"
38
40
#include " qgsvectorlayer.h"
@@ -3097,15 +3099,15 @@ void QgsVectorLayer::destroyEditCommand()
3097
3099
undoStack ()->endMacro ();
3098
3100
undoStack ()->undo ();
3099
3101
3102
+ #if QT_VERSION >= 0x050900 // setObsolete is new in Qt 5.9
3100
3103
// it's not directly possible to pop the last command off the stack (the destroyed one)
3101
3104
// and delete, so we add a dummy obsolete command to force this to occur.
3102
3105
// Pushing the new command deletes the destroyed one, and since the new
3103
3106
// command is obsolete it's automatically deleted by the undo stack.
3104
3107
std::unique_ptr< QUndoCommand > command = qgis::make_unique< QUndoCommand >();
3105
- #if QT_VERSION >= 0x050900
3106
3108
command->setObsolete ( true );
3107
- #endif
3108
3109
undoStack ()->push ( command.release () );
3110
+ #endif
3109
3111
3110
3112
mEditCommandActive = false ;
3111
3113
mDeletedFids .clear ();
You can’t perform that action at this time.
0 commit comments