O'Reilly logo

Qt 5 Blueprints by Symeon Huang

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

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: ...

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