我必须重新加载一些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");
}
}
}