如果没有重新加载成功则等待XmlListModel

时间:2014-07-06 12:24:21

标签: javascript qml

我必须重新加载一些XmlListModel,但它需要很多秒。我不知道怎么回事。我在Qt Creator中使用analyze,大多数时候需要refreshTableListModelsReady和onrefreshTableListModelReady。有人有更好的解决方案吗?

property bool refreshTableListModelsReady: crmListModel.status == XmlListModel.Ready && allSMSPremiumReceived.status == XmlListModel.Ready

    function refreshTableList()
    {
        showMessage("Refreshing...","2");
        allSMSPremiumReceived.reload(); // reload XML list
        crmListModel.reload(); //reload xml crm list
    }

    onRefreshTableListModelsReadyChanged:
    {
        if(allSMSPremiumReceived.count!=0 && crmListModel.count!=0) //if xmllistmodel is clean
        {
            if(refreshTableListModelsReady==true) // if bool is true
            {
                fillListTableNumberModel(); //copy two xmllistmodel to one ListModel
                cutNumbersAndSortModel(); // sort and cuts some data in ListModel
                sortByTime();             // sort data by time in ListModel
                showMessage("Refreshed","0");
            }
        }
    }

0 个答案:

没有答案