[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdelibs/khtml/rendering
From:       Harri Porten <porten () kde ! org>
Date:       2008-12-12 8:44:03
Message-ID: 1229071443.549906.30245.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 896002 by porten:

Merged revision 896001:
Ony way to fix TAB getting stuck on option elements. Another
would be to reimplement handleEvent() and catch things there.

Fixes
BUG: 156164
and 7 duplicates.

 M  +15 -0     render_form.cpp  
 M  +1 -0      render_form.h  
 M  +1 -0      render_replaced.cpp  


--- branches/KDE/4.1/kdelibs/khtml/rendering/render_form.cpp #896001:896002
@@ -1206,6 +1206,7 @@
 	{
 	case Qt::Key_Tab:
 	    forward=true;
+            // fall through
 	case Qt::Key_Backtab:
 	    // ugly hack. emulate popdownlistbox() (private in QComboBox)
 	    // we re-use ke here to store the reference to the generated event.
@@ -1221,6 +1222,20 @@
     return KComboBox::eventFilter(dest, e);
 }
 
+void ComboBoxWidget::keyPressEvent(QKeyEvent *e)
+{
+    // Normally, widgets are not sent Tab keys this way in the first
+    // place as they are handled by QWidget::event() for focus handling
+    // already. But we get our events via EventPropagator::sendEvent()
+    // directly. Ignore them so that HTMLGenericFormElementImpl::
+    // defaultEventHandler() can call focusNextPrev().
+    if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) {
+        e->ignore();
+        return;
+    }
+    KComboBox::keyPressEvent(e);
+}
+
 // -------------------------------------------------------------------------
 
 RenderSelect::RenderSelect(HTMLSelectElementImpl *element)
--- branches/KDE/4.1/kdelibs/khtml/rendering/render_form.h #896001:896002
@@ -413,6 +413,7 @@
 protected:
     virtual bool event(QEvent *);
     virtual bool eventFilter(QObject *dest, QEvent *e);
+    virtual void keyPressEvent(QKeyEvent *e);
     virtual void showPopup();
     virtual void hidePopup();
 };
--- branches/KDE/4.1/kdelibs/khtml/rendering/render_replaced.cpp #896001:896002
@@ -854,6 +854,7 @@
 }
 
 void RenderWidget::EventPropagator::sendEvent(QEvent *e) {
+    // ### why don't we just call event()? That would be the normal route.
     switch(e->type()) {
     case QEvent::Wheel:
         wheelEvent ( static_cast<QWheelEvent *> (e) );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic