Error in Header documentation

Bug #1557252 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Fix Committed
Medium
Tim Peeters

Bug Description

https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.Header/

on the link, the sample code:

import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
    width: units.gu(50)
    height: units.gu(70)
    header: Header {
        width: parent.width
        height: units.gu(6)
        flickable: scrollableContent
        Rectangle {
            // to visualize the header
            anchors.fill: parent
            color: UbuntuColors.blue
        }
    }
    Flickable {
        id: scrollableContent
        anchors.fill: parent
        contentHeight: height * 2
        Label {
            text: "Flick me"
        }
    }
}

When running, it gives the error like:

qrc:///Main.qml:32:13: Cannot assign to non-existent property "header"

Best regards,
XiaoGuo

Related branches

Revision history for this message
Tim Peeters (tpeeters) wrote :

You need at least UITK r1685 to have the Page.header property.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
assignee: nobody → Tim Peeters (tpeeters)
importance: Undecided → High
Revision history for this message
Tim Peeters (tpeeters) wrote :

You can check your version like this:

tim@tim-mbp:~$ apt-cache policy qml-module-ubuntu-components
qml-module-ubuntu-components:
  Installed: 1.3.1918+16.04.20160404-0ubuntu1
  Candidate: 1.3.1918+16.04.20160404-0ubuntu1
  Version table:
 *** 1.3.1918+16.04.20160404-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

For me it shows r1918, which is newer than 1685 so I have Page.header.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Tim Peeters (tpeeters) wrote :

Oops I read the code too quick: You are using an Item which does not have a header property. I will fix the error in the documentation.

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → In Progress
summary: - Cannot assign to non-existent property "header"
+ Error in Header documentation
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: High → Medium
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.