On Friday 21 October 2011 19:50:33 Mark wrote:
> On Tue, Oct 18, 2011 at 8:33 PM, Mark <[email protected]> wrote:
> > Hi,
> > 
> > I want to adjust QShortcut to use it for global shortcuts as well and
> > would like to lay out my idea on how i intend to do that. Any feedback
> > on it would be more then welcome.
> > 
> > The first thing to do is add an enum value to Qt::ShortcutContext
> > http://doc.qt.nokia.com/latest/qt.html#ShortcutContext-enum:
> > Qt::SystemShortcut (that becomes value 5) with the description: "The
> > shortcut is active in a system wide context when the application is
> > running."
> > 
> > Next up is probably (being optimistic here) tweaking the eventFilter of
> > the QShortcut class to act on global shortcuts for Windows, Linux and
> > MAC when the Qt::SystemShortcut enum is set.

This was discussed before, and the problem is that one would want a framework 
to register the global shortcut into a central place on the system that handle 
conflicts in shortcut and proper configuration.
KDE has such a thing, i don't know about the other systems.

> > 
> > Now some questions pop up. It has been said that (global) shortcuts
> > should probably be handled through the window manager. In Qt's case
> > that means (?) through LightHouse right?

Not really.
Qt application need to work on all the platform and window manager.

> > But how am i supposed to do that? Where is lighthouse even hidden?
> > And what happened to QtCore? Is that now QtBase?

Lighthouse is the codename for QPA. That is, the windowing system abstraction 
layer and its plugins.
The abstraction layer is in QtGui (all the files with _qpa), the plugins are 
in src/plugins/platforms

Considering global shortcut is part of that, i guess you need to add some 
interface in the abstraction layer, and then a specific implementation for 
each platform in the plugins.
Note that this would only be the "client" code.


The server side framework to handle the registration or the conflicts is 
outside of the scope of Qt. 


> > So where do i get started with this?

Checkout the code, open the editor :-)

> > And I've never build Qt 5 yet nor did i ever contribute actual code to
> > it.. so that's gonna be interesting.

Everything has a begining :-)


But you should definitively look at previous implemntations (such as the one 
in qxt). And in particular how the kde infrastructure works, because it would 
be nice if it was integrated into it.

That said, being perfect the first time is not possible.

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to