O'Reilly logo

Game Programming Using Qt by Lorenz Haas, Witold Wysota

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

Time for action – creating a Qt Script editor

Let's do a simple exercise and create a graphical editor to write and execute scripts. Start by creating a new GUI project and implement a main window composed of two plain text edit widgets (ui->codeEditor and ui->logWindow) that are separated using a vertical splitter. One of the edit boxes will be used as an editor to input code and the other will be used as a console to display script results. Then, add a menu and toolbar to the window and create actions to open (ui->actionOpen) and save (ui->actionSave) the document, create a new document (ui->actionNew), execute the script (ui->actionExecute), and to quit the application (ui->actionQuit). Remember to add them to the menu and toolbar. As a result, ...

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