← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1259917] Re: Using a Qml Loader in combination with Pagestack and Tabs results in incorrect positioning

 

** Changed in: ubuntu-ui-toolkit
       Status: Fix Committed => Fix Released

-- 
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/1259917

Title:
  Using a Qml Loader in combination with Pagestack and Tabs results in
  incorrect positioning

Status in Ubuntu UI Toolkit:
  Fix Released
Status in “ubuntu-ui-toolkit” package in Ubuntu:
  Fix Released

Bug description:
  I have been investigating on using a QML Loader for the clock app to
  reduce its start-up time and improve memory usage. The clock app uses
  a structure similar to the SDK Doc examples as shown below. This
  structure basically combines PageStack and Tabs component together.

  MainView {
      id: mainView
      width: units.gu(38)
      height: units.gu(50)

      PageStack {
          id: pageStack
          Component.onCompleted: push(tabs)

          Tabs {
              id: tabs
              Tab {
                  title: "Tab 1"
                  page: Page {
                      Button {
                          anchors.centerIn: parent
                          onClicked: pageStack.push(page3)
                          text: "Press"
                      }
                  }
              }
              Tab {
                  title: "Tab 2"
                  page: Page {
                      Label {
                          anchors.centerIn: parent
                          text: "Use header to navigate between tabs"
                      }
                  }
              }
          }
          Page {
              id: page3
              visible: false
              title: "Page on stack"
              Label {
                  anchors.centerIn: parent
                  text: "Press back to return to the tabs"
              }
          }
      }
  }

  However instead of loading say "Tab 2" on startup, I chose to load it
  only when the user navigates to the tab. I achieved this by using a
  QML Loader as follows,

  Tab {
              id: tab2
              title: i18n.tr("External")
              page: Loader {
                  parent: tab2
                  anchors.fill: parent
                  source: (tabs.selectedTab === tab2) ? Qt.resolvedUrl("MyCustomPage.qml") : ""
              }
          }

  However when you switch to "tab2", you will notice that the elements
  of the page do not anchors to the bottom of the tabbar. Instead they
  overlap with the tabbar. It is as if the tabbar did not exist.

  I have attached a sample project which can be used to reproduce this
  issue. All the code that has been mentioned above in the description
  have been taken from the SDK docs only.

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