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

What just happened?

Since we exported objects as properties, we can access them by ID from outside of the form. In this code, we bind the text property of the result object to the return value of the code block that is enclosed in braces. We use argument1.text and argument2.text to access the current text of the input fields. We also use operationMultiply.checked to see whether the user checked the operationMultiply radio button. The rest is just straightforward JavaScript code.

Run the application and see how the result label automatically displays the result when the user interacts with the form.

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