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

Creating new panels dynamically with a repeater

In our feature scenarios, we are adding up to three panels to the page. We have two basic options regarding panel creation. We can treat each panel as an object with a well-defined identity, and add each one individually, or rather prefer a model-view based approach as we did in Chapter 1, Writing Acceptance Tests and Building a Visual Prototype, when we used ListView.

This second approach means that we won't have to treat each panel addition as a special case—we can just add an element to an underlying data model (a JavaScript array, a QList, and so on), and see the visual representation of the panels collection grow accordingly. We will look at this second approach, as it is more elegant and ...

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