Skip to content

Commit 556be42

Browse files
author
mhugent
committedAug 3, 2009
Apply patch from gcarillo to fix bug #1793
git-svn-id: http://svn.osgeo.org/qgis/trunk@11255 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6808be9 commit 556be42

8 files changed

+52
-1
lines changed
 

‎src/app/qgscontinuouscolordialog.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "qgslogger.h"
2828

2929
#include <QColorDialog>
30-
30+
#include <QKeyEvent>
3131

3232
QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
3333
: QDialog(), mVectorLayer( layer )
@@ -203,3 +203,12 @@ void QgsContinuousColorDialog::on_cb_polygonOutline_clicked()
203203
else
204204
outlinewidthspinbox->setEnabled( false );
205205
}
206+
207+
void QgsContinuousColorDialog::keyPressEvent( QKeyEvent * e )
208+
{
209+
// Ignore the ESC key to avoid close the dialog without the properties window
210+
if ( e->key() == Qt::Key_Escape )
211+
{
212+
e->ignore();
213+
}
214+
}

‎src/app/qgscontinuouscolordialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class QgsContinuousColorDialog: public QDialog, private Ui::QgsContinuousColorDi
4545
protected:
4646
QgsVectorLayer* mVectorLayer;
4747

48+
// Reimplements dialog keyPress event so we can ignore it
49+
void keyPressEvent( QKeyEvent * event );
50+
4851
private:
4952
/** Default constructor is private, do not use this */
5053
QgsContinuousColorDialog();

‎src/app/qgsgraduatedsymboldialog.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "qgsvectorlayer.h"
2929
#include "qgslogger.h"
3030

31+
#include <QKeyEvent>
32+
3133
QgsGraduatedSymbolDialog::QgsGraduatedSymbolDialog( QgsVectorLayer * layer ): QDialog(), mVectorLayer( layer ), sydialog( layer )
3234
{
3335
setupUi( this );
@@ -598,3 +600,12 @@ void QgsGraduatedSymbolDialog::updateEntryIcon( QgsSymbol * thepSymbol,
598600
;
599601
}
600602
}
603+
604+
void QgsGraduatedSymbolDialog::keyPressEvent( QKeyEvent * e )
605+
{
606+
// Ignore the ESC key to avoid close the dialog without the properties window
607+
if ( e->key() == Qt::Key_Escape )
608+
{
609+
e->ignore();
610+
}
611+
}

‎src/app/qgsgraduatedsymboldialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class QgsGraduatedSymbolDialog: public QDialog, private Ui::QgsGraduatedSymbolDi
7070
/**Gets the color value along a specified ramp**/
7171
QColor getColorFromRamp( QString ramp, int step, int totalSteps );
7272

73+
// Reimplements dialog keyPress event so we can ignore it
74+
void keyPressEvent( QKeyEvent * event );
75+
7376
protected slots:
7477
/**Removes a class from the classification*/
7578
void deleteCurrentClass();

‎src/app/qgssinglesymboldialog.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <QImage>
3232
#include <QFileDialog>
3333
#include <QListWidgetItem>
34+
#include <QKeyEvent>
3435

3536
#define DO_NOT_USE_STR "<off>"
3637

@@ -636,3 +637,11 @@ void QgsSingleSymbolDialog::fillStyleChanged( int theIndex )
636637

637638
}
638639

640+
void QgsSingleSymbolDialog::keyPressEvent( QKeyEvent * e )
641+
{
642+
// Ignore the ESC key to avoid close the dialog without the properties window
643+
if ( e->key() == Qt::Key_Escape )
644+
{
645+
e->ignore();
646+
}
647+
}

‎src/app/qgssinglesymboldialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class QgsSingleSymbolDialog: public QDialog, private Ui::QgsSingleSymbolDialogBa
5050
QgsVectorLayer* mVectorLayer;
5151
bool mDisabled;
5252

53+
// Reimplements dialog keyPress event so we can ignore it
54+
void keyPressEvent( QKeyEvent * event );
55+
5356
public slots:
5457
/* arrange the widgets on this dialog to reflect the current state of QgsSymbol */
5558
void unset();

‎src/app/qgsuniquevaluedialog.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "qgslogger.h"
2828

2929
#include <QMessageBox>
30+
#include <QKeyEvent>
3031

3132
QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVectorLayer( vl ), sydialog( vl, true )
3233
{
@@ -458,3 +459,12 @@ void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol * thepSymbol,
458459
//do nothing
459460
}
460461
}
462+
463+
void QgsUniqueValueDialog::keyPressEvent( QKeyEvent * e )
464+
{
465+
// Ignore the ESC key to avoid close the dialog without the properties window
466+
if ( e->key() == Qt::Key_Escape )
467+
{
468+
e->ignore();
469+
}
470+
}

‎src/app/qgsuniquevaluedialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class QgsUniqueValueDialog: public QDialog, private Ui::QgsUniqueValueDialogBase
4646
QMap<QString, QgsSymbol*> mValues;
4747
QgsSingleSymbolDialog sydialog;
4848

49+
// Reimplements dialog keyPress event so we can ignore it
50+
void keyPressEvent( QKeyEvent * event );
51+
4952
protected slots:
5053
/**Set new attribut for classification*/
5154
void changeClassificationAttribute();

0 commit comments

Comments
 (0)
Please sign in to comment.