Adding BusyIndicator

The absence of a busy indicator makes people uncomfortable as well. No matter how short or long indicator it is, it takes time to download data and parse XML. I'm pretty sure you'd like to add such an indicator, which tells users to calm down and wait. Luckily, BusyIndicator, which is simply a running circle, is an element of QtQuick.Controls. This does exactly what we want.

What you need to do is to add these lines to main.qml inside the Window item:

BusyIndicator {
  anchors.centerIn: newsView
  running: newsModel.status == XmlListModel.Loading
}

Note that we don't need to change the visible property of BusyIndicator, because BusyIndicator is only visible when the running property is set to true. In this case, we set running to ...

Get Qt 5 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.