[Digikam-devel] [Bug 116347] All the Image Plugins freeze the Image Editor and ShowFoto when validating a value in a spinbox with the key ENTER.

Gilles Caulier caulier.gilles at free.fr
Tue Nov 15 12:45:07 GMT 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=116347         
caulier.gilles free fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|general                     |Adjust Curves



------- Additional Comments From caulier.gilles free fr  2005-11-15 13:45 -------
SVN commit 480380 by cgilles:

Prevent Enter keys events between dialog and spinBox
CCBUG : 116347

 M  +38 -0     imageeffect_blur.cpp  
 M  +1 -0      imageeffect_blur.h  
 M  +38 -0     imageeffect_sharpen.cpp  
 M  +1 -0      imageeffect_sharpen.h  


--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.cpp #480379:480380
 @ -301,4 +301,42  @
     delete d;        
 }
 
+// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events 
+// to prevent any conflicts between dialog keys events and SpinBox keys events.
+
+void ImageEffect_Blur::keyPressEvent(QKeyEvent *e)
+{
+    if ( e->state() == 0 )
+    {
+        switch ( e->key() )
+        {
+        case Key_Escape:
+            e->accept();
+            reject();
+        break;
+        case Key_Enter:            
+        case Key_Return:     
+            e->ignore();              
+        break;
+        default:
+            e->ignore();
+            return;
+        }
+    }
+    else
+    {
+        // accept the dialog when Ctrl-Return is pressed
+        if ( e->state() == ControlButton &&
+            (e->key() == Key_Return || e->key() == Key_Enter) )
+        {
+            e->accept();
+            accept();
+        }
+        else
+        {
+            e->ignore();
+        }
+    }
+}
+
 #include "imageeffect_blur.moc"
--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.h #480379:480380
 @ -80,6 +80,7  @
     void closeEvent(QCloseEvent *e);
     void customEvent(QCustomEvent *event);
     void abortPreview(void);
+    void keyPressEvent(QKeyEvent *e);
 };
 
 #endif /* IMAGEEFFECT_BLUR_H */
--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.cpp #480379:480380
 @ -301,4 +301,42  @
     delete d;        
 }
 
+// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events 
+// to prevent any conflicts between dialog keys events and SpinBox keys events.
+
+void ImageEffect_Sharpen::keyPressEvent(QKeyEvent *e)
+{
+    if ( e->state() == 0 )
+    {
+        switch ( e->key() )
+        {
+        case Key_Escape:
+            e->accept();
+            reject();
+        break;
+        case Key_Enter:            
+        case Key_Return:     
+            e->ignore();              
+        break;
+        default:
+            e->ignore();
+            return;
+        }
+    }
+    else
+    {
+        // accept the dialog when Ctrl-Return is pressed
+        if ( e->state() == ControlButton &&
+            (e->key() == Key_Return || e->key() == Key_Enter) )
+        {
+            e->accept();
+            accept();
+        }
+        else
+        {
+            e->ignore();
+        }
+    }
+}
+
 #include "imageeffect_sharpen.moc"
--- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.h #480379:480380
 @ -80,6 +80,7  @
     void closeEvent(QCloseEvent *e);
     void customEvent(QCustomEvent *event);
     void abortPreview(void);
+    void keyPressEvent(QKeyEvent *e);
 };
 
 #endif /* IMAGEEFFECT_SHARPEN_H */



More information about the Digikam-devel mailing list