Skip to content

Commit 398fb1a

Browse files
committedMay 4, 2018
Only apply f4d38d4 to Qt>=5.9 (followup f4d38d4; check cdash for
test results)
1 parent 9836dc2 commit 398fb1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/core/qgsvectorlayer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
#include <QDomNode>
3333
#include <QVector>
3434
#include <QStringBuilder>
35+
#if QT_VERSION >= 0x050900
3536
#include <QUndoCommand>
37+
#endif
3638

3739
#include "qgssettings.h"
3840
#include "qgsvectorlayer.h"
@@ -3097,15 +3099,15 @@ void QgsVectorLayer::destroyEditCommand()
30973099
undoStack()->endMacro();
30983100
undoStack()->undo();
30993101

3102+
#if QT_VERSION >= 0x050900 // setObsolete is new in Qt 5.9
31003103
// it's not directly possible to pop the last command off the stack (the destroyed one)
31013104
// and delete, so we add a dummy obsolete command to force this to occur.
31023105
// Pushing the new command deletes the destroyed one, and since the new
31033106
// command is obsolete it's automatically deleted by the undo stack.
31043107
std::unique_ptr< QUndoCommand > command = qgis::make_unique< QUndoCommand >();
3105-
#if QT_VERSION >= 0x050900
31063108
command->setObsolete( true );
3107-
#endif
31083109
undoStack()->push( command.release() );
3110+
#endif
31093111

31103112
mEditCommandActive = false;
31113113
mDeletedFids.clear();

0 commit comments

Comments
 (0)
Please sign in to comment.