Skip to content

Commit

Permalink
Apply patch from gcarillo to fix bug #1793
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11255 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 3, 2009
1 parent 6808be9 commit 556be42
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/qgscontinuouscolordialog.cpp
Expand Up @@ -27,7 +27,7 @@
#include "qgslogger.h"

#include <QColorDialog>

#include <QKeyEvent>

QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
: QDialog(), mVectorLayer( layer )
Expand Down Expand Up @@ -203,3 +203,12 @@ void QgsContinuousColorDialog::on_cb_polygonOutline_clicked()
else
outlinewidthspinbox->setEnabled( false );
}

void QgsContinuousColorDialog::keyPressEvent( QKeyEvent * e )
{
// Ignore the ESC key to avoid close the dialog without the properties window
if ( e->key() == Qt::Key_Escape )
{
e->ignore();
}
}
3 changes: 3 additions & 0 deletions src/app/qgscontinuouscolordialog.h
Expand Up @@ -45,6 +45,9 @@ class QgsContinuousColorDialog: public QDialog, private Ui::QgsContinuousColorDi
protected:
QgsVectorLayer* mVectorLayer;

// Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );

private:
/** Default constructor is private, do not use this */
QgsContinuousColorDialog();
Expand Down
11 changes: 11 additions & 0 deletions src/app/qgsgraduatedsymboldialog.cpp
Expand Up @@ -28,6 +28,8 @@
#include "qgsvectorlayer.h"
#include "qgslogger.h"

#include <QKeyEvent>

QgsGraduatedSymbolDialog::QgsGraduatedSymbolDialog( QgsVectorLayer * layer ): QDialog(), mVectorLayer( layer ), sydialog( layer )
{
setupUi( this );
Expand Down Expand Up @@ -598,3 +600,12 @@ void QgsGraduatedSymbolDialog::updateEntryIcon( QgsSymbol * thepSymbol,
;
}
}

void QgsGraduatedSymbolDialog::keyPressEvent( QKeyEvent * e )
{
// Ignore the ESC key to avoid close the dialog without the properties window
if ( e->key() == Qt::Key_Escape )
{
e->ignore();
}
}
3 changes: 3 additions & 0 deletions src/app/qgsgraduatedsymboldialog.h
Expand Up @@ -70,6 +70,9 @@ class QgsGraduatedSymbolDialog: public QDialog, private Ui::QgsGraduatedSymbolDi
/**Gets the color value along a specified ramp**/
QColor getColorFromRamp( QString ramp, int step, int totalSteps );

// Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );

protected slots:
/**Removes a class from the classification*/
void deleteCurrentClass();
Expand Down
9 changes: 9 additions & 0 deletions src/app/qgssinglesymboldialog.cpp
Expand Up @@ -31,6 +31,7 @@
#include <QImage>
#include <QFileDialog>
#include <QListWidgetItem>
#include <QKeyEvent>

#define DO_NOT_USE_STR "<off>"

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

}

void QgsSingleSymbolDialog::keyPressEvent( QKeyEvent * e )
{
// Ignore the ESC key to avoid close the dialog without the properties window
if ( e->key() == Qt::Key_Escape )
{
e->ignore();
}
}
3 changes: 3 additions & 0 deletions src/app/qgssinglesymboldialog.h
Expand Up @@ -50,6 +50,9 @@ class QgsSingleSymbolDialog: public QDialog, private Ui::QgsSingleSymbolDialogBa
QgsVectorLayer* mVectorLayer;
bool mDisabled;

// Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );

public slots:
/* arrange the widgets on this dialog to reflect the current state of QgsSymbol */
void unset();
Expand Down
10 changes: 10 additions & 0 deletions src/app/qgsuniquevaluedialog.cpp
Expand Up @@ -27,6 +27,7 @@
#include "qgslogger.h"

#include <QMessageBox>
#include <QKeyEvent>

QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVectorLayer( vl ), sydialog( vl, true )
{
Expand Down Expand Up @@ -458,3 +459,12 @@ void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol * thepSymbol,
//do nothing
}
}

void QgsUniqueValueDialog::keyPressEvent( QKeyEvent * e )
{
// Ignore the ESC key to avoid close the dialog without the properties window
if ( e->key() == Qt::Key_Escape )
{
e->ignore();
}
}
3 changes: 3 additions & 0 deletions src/app/qgsuniquevaluedialog.h
Expand Up @@ -46,6 +46,9 @@ class QgsUniqueValueDialog: public QDialog, private Ui::QgsUniqueValueDialogBase
QMap<QString, QgsSymbol*> mValues;
QgsSingleSymbolDialog sydialog;

// Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );

protected slots:
/**Set new attribut for classification*/
void changeClassificationAttribute();
Expand Down

0 comments on commit 556be42

Please sign in to comment.