No error output if item is used for the Page assignment

Bug #1436767 reported by XiaoGuo, Liu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Opinion
Low
Tim Peeters

Bug Description

I have a sample QML application at: https://gitcafe.com/ubuntu/TabApp2.git

You may use the command:

git clone https://gitcafe.com/ubuntu/TabApp2.git

to get the code.

In the ExternalPage.qml,

import QtQuick 2.0
import Ubuntu.Components 1.1

Item {
    anchors.fill: parent
    Label {
        anchors.centerIn: parent
        text: i18n.tr("This is page xxx one")
    }
}

I defined it as an "Item". However, when I assign it in the following way:

       Tab {
            id: externalTab
            title: i18n.tr("External")

            page: Loader {
                id: loader
                anchors.fill: parent
                source: (tabs.selectedTab === externalTab) ? Qt.resolvedUrl("ExternalPage.qml") : ""

                onLoaded: {
                    console.log( loader.source + " is loaded")
                }
            }
        }

it does not output any error messages, making it hard to use if a developer does not know how to define it.

Best regards,
XiaoGuo

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → Low
Revision history for this message
Tim Peeters (tpeeters) wrote :

What you put in a Tab (or on a PageStack) does not have to be a Page, so there is no error output.

Of source, if you don't use a Page, you don't have the features of the Page such as actions in the header, or setting a title.

Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Tim Peeters (tpeeters)
status: Confirmed → Opinion
Revision history for this message
Cris Dywan (kalikiana) wrote :

Still you end up with the wrong title set and no way to fix it… I don't see how this can be intended.

Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

yes, I currently get it working by defining it like:

ExternalPage.qml

Page {
    Label {
        anchors.centerIn: parent
        text: i18n.tr("This is the external page")
    }
}

If it is defined to be like:

ExternalPage.qml

import QtQuick 2.0
import Ubuntu.Components 1.1

Item {
    anchors.fill: parent
    Label {
        anchors.centerIn: parent
        text: i18n.tr("This is page xxx one")
    }
}

It does not work. The intention for the bug is to have some warnings when non-page is assigned during the running. Otherwise, a developer does not know what is happening or what could be wrong when an "Item" is assigned to a page.

Best regards,
XiaoGuo

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.