Understanding model and view
As mentioned before, Qt Quick applications are different from traditional Qt Widgets applications. You are going to write QML instead of C++ code. So, let's create a new project, a Qt Quick application named RSS_Reader
. This time, we will use Qt Quick 2.3 as the component set. Since we won't use the widgets provided by Qt Quick Controls, we'll write our own widgets.
Before getting our hands dirty, let's sketch out what this application looks like. According to the following diagram, there will be two sections. The left-hand panel provides some categories so that users can choose interesting categories. The right-hand panel is the main area, which displays news under the current category. This is a typical RSS news reader's user interface.
We can implement the Categories panel by using ListView
. This type (we say "type" instead of "class" in QML) is used to display data from all sorts of list models. So let's edit...