Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Posts: 8
Registered: ‎02-17-2013
My Device: Z10 LE
My Carrier: Sosh

App stuck affecting property

I have an issue with a list/detail pattern. I have an Article class, inheriting from QObject, defining some properties (title, updated and content being the ones that matters for now). To populate my (QML) ListView, I have a C++ GroupDataModel, filled with some Article*. Here's my list's onTriggered:

onTriggered: {
    if (indexPath.length > 1) {
        currentArticle = dataModel.data(indexPath);
        var page = articlePageDefinition.createObject();
        nav.push(page)
    }
}

As you can guess, the articlePageDefinition defines a page using the upper currentArticle property.

 

Now, when I display the articlePage once, it's working fine. I can go back, click on the same list item, display the same Article details, works great. But when I pick a second article, the app kind of freezes. I can go back in my navigation pane, but I can't click on list items anymore. I tried to add some logs, the onTriggered is stuck on currentArticle = dataModel.data(indexPath);. At this point, I can log every property of dataModel.data(indexPath) without any issue. I tried to not create/push the page, simply affect currentArticle and display some of its properties, it's working fine too. I really don't understand what I am doing wrong here, any help appreciated.

 

In case you need to see more code, everything is here: https://github.com/Kernald/tt-rss-bb10/tree/e29e3b616aa179dd42f66804ecc20a6a45b6bb22

New Contributor
Posts: 8
Registered: ‎02-17-2013
My Device: Z10 LE
My Carrier: Sosh

Re: App stuck affecting property

OK, I found something. I moved currentArticle (which is a property defined in a top-level component) un the ArticlePage, and I assign it on the newly created page. It's working fine, now. I really can't understand why it's not working with the first solution however, if anybody has an explanation…