O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Have a go hero – Practicing key-event propagation

As an exercise, you can expand our last example by building a larger array of items (you can use the Grid element to position them) and defining a navigation system that makes use of the KeyNavigation attached property. Have some of the items handle events themselves using the Keys attached property. See what happens when the same key is handled by both mechanisms. Try influencing the behavior using the priority property.

When you set the focus property of an item to true, any previously used item loses focus. This becomes a problem when you try to write a reusable component that needs to set focus to its children. If you add multiple instances of such a component to a single window, their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required