Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have the following code:

Tabs {
    Tab {
        id: financialDetailsTab
        title: i18n.tr("Financial Details")
        page: Qt.resolvedUrl("FinancialDetails.qml")
    }
    Tab {
        id: monthlyBudgetTab
        title: i18n.tr("Monthly Budget")
        page: Qt.resolvedUrl("MonthlyBudget.qml")
    }
    Tab {
        id: annualBudgetTab
        title: i18n.tr("Annual Budget")
        page: Qt.resolvedUrl("AnnualBudget.qml")
    }
    Tab {
        id: savingsGoalsTab
        title: i18n.tr("Savings Goals")
        page: Qt.resolvedUrl("SavingsGoals.qml")
    }
}

which is generating the following errors:

Unable to assign QString to QQuickItem*
Unable to assign QString to QQuickItem*
Unable to assign QString to QQuickItem*
Unable to assign QString to QQuickItem*

on the lines where Qt::resolvedUrl is being used. The Tabs component is a part of the Ubuntu SDK, and not Qt Quick, and the only example of it's use doesn't provide much insight into the problem.

I've added the exact same lines as properties of the MainView, outside of the Tabs component, and the problem has not been evident there, leading me to believe the issue lies with the Ubuntu component.

All the files exist and sit at the same level in the project as this one. What am I doing wrong here?

share|improve this question
    
I don't know what you mean, with "I've added the exact same lines as properties of the MainView, outside of the Tabs component"... and that it was without a problem. Don't know what you wrote exactly. –  payload Mar 27 '13 at 14:40
add comment

1 Answer 1

up vote 2 down vote accepted

The correct way of writing this is:

Tabs {
  Tab {
    page: FinancialDetails {}
    // ...
  }
  // ...
}

page wants an Item, but Qt.resolvedUrl returns a string. Which won't be interpreted as a URL to an Item and it therefore won't be loaded.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.