← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1515635] [NEW] head.visible does not work if binded to other property

 

Public bug reported:

Changing visibility of a page header does not seem to work if
head.visible is binded to another property and that property changes.

This code works (visibility changes on button click):

import QtQuick 2.4
import Ubuntu.Components 1.3

Page {
    id: root

    title: "Test page"

    head.visible: true

    Button {
        anchors.centerIn: parent
        onClicked: {
            if (root.head.visible) {
                root.head.visible = false
            }
            else {
                root.head.visible = true
            }
        }
    }
}

This one doesn't work:

import QtQuick 2.4
import Ubuntu.Components 1.3

Page {
    id: root

    property bool isHeaderVisible: true

    title: "Test page"

    head.visible: isHeaderVisible

    Button {
        anchors.centerIn: parent
        onClicked: {
            if (root.isHeaderVisible) {
                root.isHeaderVisible = false
            }
            else {
                root.isHeaderVisible = true
            }
        }
    }
}

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1515635

Title:
  head.visible does not work if binded to other property

Status in ubuntu-ui-toolkit package in Ubuntu:
  Confirmed

Bug description:
  Changing visibility of a page header does not seem to work if
  head.visible is binded to another property and that property changes.

  This code works (visibility changes on button click):

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  Page {
      id: root

      title: "Test page"

      head.visible: true

      Button {
          anchors.centerIn: parent
          onClicked: {
              if (root.head.visible) {
                  root.head.visible = false
              }
              else {
                  root.head.visible = true
              }
          }
      }
  }

  This one doesn't work:

  import QtQuick 2.4
  import Ubuntu.Components 1.3

  Page {
      id: root

      property bool isHeaderVisible: true

      title: "Test page"

      head.visible: isHeaderVisible

      Button {
          anchors.centerIn: parent
          onClicked: {
              if (root.isHeaderVisible) {
                  root.isHeaderVisible = false
              }
              else {
                  root.isHeaderVisible = true
              }
          }
      }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1515635/+subscriptions