O'Reilly logo

Qt 5 Projects by Marco Piccolino

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

Adding the controls menu and the element creation options

All of these controls are provided by default by the Qt Quick Controls 2 module. We create a simple grey Rectangle to contain the controls, a Column positioner to display them vertically, and then add the checkboxes to choose the element's shape and the add element and remove element buttons, as follows:

// cccomposer/main.qmlimport QtQuick 2.0import cutecomics.gui 1.0import QtQuick.Window 2.3import QtQuick.Scene3D 2.0import QtQuick.Controls 2.2Window {    visible: true    width: 800    height: 600    Scene3D {        anchors.top: parent.top        anchors.bottom: parent.bottom        anchors.left: parent.left        anchors.right: menu.left        ...    }    Rectangle {        id: menu        width: 160        color: "#999" anchors.right: parent.right ...

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