[Interest] QML Window handling focus events

Alan Alpert 416365416c at gmail.com
Tue May 21 03:57:16 CEST 2013

On Mon, May 20, 2013 at 5:56 PM, Daiwei Li <daiweili at gmail.com> wrote:
> It looks the QQuickWindow C++ class has focusIn and focusOut event handlers
> that you can override, but there's no signal in QML. Am I missing something
> or is it intentionally left out of QML?

The QML API for QQuickWindow is still young (and growing slowly), but
that signal is being added in Qt 5.1 (onActiveChanged). In Qt 5.0,
there is an application.active property you can listen to in QML to
see if the application as a whole is active, but it's not granular to
individual windows.

There's no distinction between window focusIn/Out and window
active/inactive. Leaving that out is intentional, because it's rarely
an important distinction (and when it is, you have the C++ API).

Alan Alpert

More information about the Interest mailing list