[uim-commit] r536 - trunk/qt

kzk at freedesktop.org kzk at freedesktop.org
Fri Feb 4 23:35:00 PST 2005


Author: kzk
Date: 2005-02-04 23:34:57 -0800 (Fri, 04 Feb 2005)
New Revision: 536

Modified:
   trunk/qt/pref-customwidgets.cpp
Log:
* qt/pref-customwidgets.cpp
  - (KeyGrabForm): filter all key event of child widgets.


Modified: trunk/qt/pref-customwidgets.cpp
===================================================================
--- trunk/qt/pref-customwidgets.cpp	2005-02-05 07:21:01 UTC (rev 535)
+++ trunk/qt/pref-customwidgets.cpp	2005-02-05 07:34:57 UTC (rev 536)
@@ -820,7 +820,12 @@
 KeyGrabForm::KeyGrabForm( QWidget *parent, const char *name )
     : KeyGrabFormBase( parent, name )
 {
-
+    m_shiftCheckBox->installEventFilter( this );
+    m_controlCheckBox->installEventFilter( this );
+    m_altCheckBox->installEventFilter( this );
+    m_keyLineEdit->installEventFilter( this );
+    m_okButton->installEventFilter( this );
+    m_cancelButton->installEventFilter( this );
 }
 
 void KeyGrabForm::keyPressEvent( QKeyEvent *e )
@@ -984,4 +989,16 @@
     m_keystr = keystr;
 }
 
+bool KeyGrabForm::eventFilter( QObject * watched, QEvent * e )
+{
+    if( e->type() == QEvent::KeyPress )
+    {
+        keyPressEvent( (QKeyEvent*)e );
+        return true;
+    }
+
+    return false;
+}
+
+
 #include "pref-customwidgets.moc"



More information about the Uim-commit mailing list