Tweaking the categories

This application is still incomplete. For example, the news view won't change at all after you click on the other categories. In this stage, we're going to work this out and make it more beautiful.

What we need to do is add MouseArea to CategoriesDelegate. This element is used to deal with a variety of mouse interactions, including clicking. The new CategoriesDelegate.qml file's code is pasted here:

import QtQuick 2.3 Rectangle { id: delegate height: 80 Text { id: title anchors { left: parent.left; leftMargin: 10; right: parent.right; rightMargin: 10 } anchors.verticalCenter: delegate.verticalCenter text: name font { pointSize: 18; bold: true } verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap } MouseArea { anchors.fill: ...

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.