Skip to content

Commit 0d39964

Browse files
committedMay 10, 2016
[Style Dock] Add undo/redo button at the bottom
1 parent ca914f1 commit 0d39964

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
 

‎src/app/qgsmapstylingwidget.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,17 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QWidget *parent
5050
mLiveApplyCheck = new QCheckBox( "Live update" );
5151
mLiveApplyCheck->setChecked( true );
5252

53+
mUndoButton = new QToolButton( this );
54+
mUndoButton->setIcon( QgsApplication::getThemeIcon( "mActionUndo.png" ) );
55+
mRedoButton = new QToolButton( this );
56+
mRedoButton->setIcon( QgsApplication::getThemeIcon( "mActionRedo.png" ) );
57+
58+
connect( mUndoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( undo() ) );
59+
connect( mRedoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( redo() ) );
60+
5361
QHBoxLayout* bottomLayout = new QHBoxLayout( );
62+
bottomLayout->addWidget( mUndoButton );
63+
bottomLayout->addWidget( mRedoButton );
5464
bottomLayout->addWidget( mButtonBox );
5565
bottomLayout->addWidget( mLiveApplyCheck );
5666
layout->addLayout( bottomLayout );

‎src/app/qgsmapstylingwidget.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef QGSMAPSTYLESDOCK_H
22
#define QGSMAPSTYLESDOCK_H
33

4+
#include <QToolButton>
45
#include <QWidget>
56
#include <QLabel>
67
#include <QTabWidget>
@@ -67,7 +68,8 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget
6768
QgsRendererV2PropertiesDialog* mVectorStyleWidget;
6869
QDialogButtonBox* mButtonBox;
6970
QCheckBox* mLiveApplyCheck;
70-
71+
QToolButton* mUndoButton;
72+
QToolButton* mRedoButton;
7173
};
7274

7375
#endif // QGSMAPSTYLESDOCK_H

0 commit comments

Comments
 (0)
Please sign in to comment.