How to do it...

In this project, we'll be doing something quite different:

  1. As usual, the first step we should do is to create a new project by going to File | New File or Project and selecting Qt Quick Application - Empty as the project template:
  1. Once you are done creating the new project, open up main.qml, which is listed under qml.qrc in the project pane. After that, set an ID for the window and adjust its width and height to larger values, like so:
import QtQuick 2.11import QtQuick.Window 2.11Window {    id: myWindow    visible: true    width: 640    height: 480    title: qsTr("Hello World")}
  1. Then, add a Canvas object under myWindow and call it ...

Get Qt5 C++ GUI Programming Cookbook - 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.