Skip to content


Browse files Browse the repository at this point in the history
Only apply f4d38d4 to Qt>=5.9 (followup f4d38d4; check cdash for
test results)
  • Loading branch information
jef-n committed May 4, 2018
1 parent 9836dc2 commit 398fb1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -32,7 +32,9 @@
#include <QDomNode>
#include <QVector>
#include <QStringBuilder>
#if QT_VERSION >= 0x050900
#include <QUndoCommand>

#include "qgssettings.h"
#include "qgsvectorlayer.h"
Expand Down Expand Up @@ -3097,15 +3099,15 @@ void QgsVectorLayer::destroyEditCommand()

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

mEditCommandActive = false;
Expand Down

0 comments on commit 398fb1a

Please sign in to comment.