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

Defining the comic panel

To keep things clean, we won't define our panel within the page, but rather define a separate component, and use property aliases to pass it as the delegate of the repeater. We go ahead and create a ComicPanel.qml file with this content:

// ComicPanel.qmlimport QtQuick 2.9Item {    width: 100    height: 100    Rectangle {        anchors.fill: parent        border.color: "#000"        border.width: 2        opacity: 0.5    }}

We have given the panel an arbitrary size to make it visible in isolation. The GridLayout will take care to modify its appearance via the attached properties, as we will see shortly.

In this case, make sure you don't have one dimension of the root Item rely on the other via property binding (for example, width: height), as this might ...

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