int counter = 0 ;
while(!n.isNull()) {
if(!e.isNull()) {
if(e.tagName() != "movie"){
return false;
}
}
while(!c.isNull()){
tabmovies->insertRow(1);
if(k.
tagName() == "name"){tabmovies
->setItem
(counter,
0,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "weburl"){ tabmovies
->setItem
(counter,
1,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "year"){tabmovies
->setItem
(counter,
2,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "image"){tabmovies
->setItem
(counter,
3,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "quality"){tabmovies
->setItem
(counter,
4,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "onhdd"){tabmovies
->setItem
(counter,
5,
QTableWidgetItem(k.
text()));
} if(k.
tagName() == "path"){tabmovies
->setItem
(counter,
6,
QTableWidgetItem(k.
text()));
} c = c.nextSibling();
}
counter++;
n = n.nextSibling();
}
return true;
int counter = 0 ;
while(!n.isNull()) {
QDomElement e = n.toElement();
if(!e.isNull()) {
if(e.tagName() != "movie"){
return false;
}
}
QDomNode c = e.firstChild();
while(!c.isNull()){
QDomElement k = c.toElement();
tabmovies->insertRow(1);
if(k.tagName() == "name"){tabmovies->setItem(counter,0,QTableWidgetItem(k.text()));}
if(k.tagName() == "weburl"){ tabmovies->setItem(counter,1,QTableWidgetItem(k.text())); }
if(k.tagName() == "year"){tabmovies->setItem(counter,2,QTableWidgetItem(k.text()));}
if(k.tagName() == "image"){tabmovies->setItem(counter,3,QTableWidgetItem(k.text()));}
if(k.tagName() == "quality"){tabmovies->setItem(counter,4,QTableWidgetItem(k.text()));}
if(k.tagName() == "onhdd"){tabmovies->setItem(counter,5,QTableWidgetItem(k.text()));}
if(k.tagName() == "path"){tabmovies->setItem(counter,6,QTableWidgetItem(k.text()));}
c = c.nextSibling();
}
counter++;
n = n.nextSibling();
}
return true;
To copy to clipboard, switch view to plain text mode
Bookmarks