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

Laying out the UI components required by the scenarios

Going back to our scenarios, we need:

  1. A way to represent the list of available grocery items
  2. A way to add new grocery items by their name
  3. A way to remove existing grocery items that are no longer in the fridge

We first add Page1 to  main.qml, and make changes, until we get the following:

// gui/main.qmlimport QtQuick 2.9import QtQuick.Controls 2.2import QtQuick.Layouts 1.3ApplicationWindow {    visible: true    width: 320    height: 480    title: "What's in my fridge?"    Page1 {        anchors.fill: parent    }}
The width and height of 320x340 has been chosen as it is the minimum resolution of some mobile devices still present on the market, and thus serves as a minimal area for which you should make sure ...

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