accel problems: might be qt-copt, might be kdelibs

Ingo Klöcker kloecker at kde.org
Sun Oct 13 11:33:39 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 13 October 2002 11:10, David Faure wrote:
> On Sunday 13 October 2002 11:05, Marc Mutz wrote:
> > On Sunday 13 October 2002 10:17, David Faure wrote:
> > > Yes, this sounds like a side effect of Ellis' AccelOverride
> > > change. What should happen here? Is the focus widget is the
> > > listview or the KHTML view?
> >
> > It's primarily seen with listviews. If you click on one, it will
> > have focus. And a lot of keys bound to navigation.
> >
> > What should happen is that if a hotkey is consumed by a KAction, it
> > shouldn't be propagated to the focus widget anymore. I see the
> > problem that for edit fields you want it vice versa, though.
>
> When are the listview's hotkeys going to be applicable then?
> Shouldn't it rather be that "if the focus widget consumes a hotkey,
> it shouldn't be propagated to the mainwindow - i.e. the KActions" ?

The problem is that we want to override all actions of the listview with
our own KActions. And these KActions are defined in KMMainWindow
because it handles the actions for all our widgets. I guess we will
have to overwrite KListView::keyPressEvent() in order to prevent the
listview from stealing our keys. The following crude patch which simply 
hides all key press events from our listview seems to fix our problems 
AFAICS.

======
- --- kmfoldertree.h~     Mon Oct  7 20:37:55 2002
+++ kmfoldertree.h      Sun Oct 13 12:24:20 2002
@@ -194,6 +194,14 @@
   /** Catch palette changes */
   virtual bool event(QEvent *e);

+  /**
+   * Reimplemented in order to suppress keys which should be processed
+   * by the main window.
+   *
+   * The API is unaffected.
+   */
+  virtual void keyPressEvent( QKeyEvent* ) {};
+
   virtual void paintEmptyArea( QPainter * p, const QRect & rect );

   /** Updates the number of unread messages for all folders */
======

Is this approach correct?

Regards,
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE9qUwFGnR+RTDgudgRAj1eAJ4++wDE9295fvKIHzW9M47nw0sJVQCeLRLq
QGfASCA0U/1XHiPZAAoeUIk=
=Tzyv
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list