Time for action – Creating a JavaScript editor

Let's do a simple exercise and create a graphical editor to write and execute scripts. Start by creating a new Qt Widgets 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->actionOpenDocument) and save (ui->actionSaveDocument and ui->actionSaveDocumentAs) the document, create a new document (ui->actionNewDocument), execute the script (ui->actionExecuteScript), and to quit the application ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.