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 page

We now create a separate QML document for the ComicPage UI component:

// ComicPage.qmlimport QtQuick 2.9Item {    id: page    width: 480    height: width    Rectangle {        anchors.fill: parent    }}

Nothing new here, except for the fact that we decide the ComicPage to be square-shaped by default, and thus make its height reflect its width. We also do not specify the color of the Rectangle, as we are content with its default value,  "#ffffff". Firing qmlscene will show a non-exciting white square.

Now that the ComicPage is there, we can stack it on top of the TableSurface. Let's first create a  CCPanels.qml document that we will use for testing purposes to combine our components:

// CCPanels.qmlimport QtQuick 2.9TableSurface { ComicPage { } ...

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