treeView->setModel(model);
void GamesTab::showMatches()
{
treeView->setUpdatesEnabled (false);
modelindex = model->index(0, 0, modelindex);
model->insertRows(0, mainBoard->filteredResults.size(), modelindex);
for (unsigned int i = 0; i < mainBoard->filteredResults.size(); i++) {
int db = mainBoard->filteredResults[i]->dbIndex;
int game = mainBoard->filteredResults[i]->gameIndex;
gamePtr = dbManager_->databases[db]->database->Games[game];
data = (dbManager_->databases[db]->name).c_str();
model->setData(model->index(i, headerPosDatabase_, modelindex), data);
data = (gamePtr->getPlayerW()).c_str();
model->setData(model->index(i, headerPosPlayerWhite_, modelindex), data);
data = (gamePtr->getPlayerB()).c_str();
model->setData(model->index(i, headerPosPlayerBlack_, modelindex), data);
data = (gamePtr->getRankW()).c_str();
model->setData(model->index(i, headerPosRankWhite_, modelindex), data);
data = (gamePtr->getRankB()).c_str();
model->setData(model->index(i, headerPosRankBlack_, modelindex), data);
data = (gamePtr->getResultStr()).c_str();
model->setData(model->index(i, headerPosResult_, modelindex), data);
data = (gamePtr->getKomi()).c_str();
model->setData(model->index(i, headerPosKomi_, modelindex), data);
data = (gamePtr->getDate()).c_str();
model->setData(model->index(i, headerPosDate_, modelindex), data);
data = gamePtr->getMoveCount();
model->setData(model->index(i, headerPosMoveCount_, modelindex), data);
data = (gamePtr->getHandicap()).c_str();
model->setData(model->index(i, headerPosHandicap_, modelindex), data);
data = (gamePtr->getPlace()).c_str();
model->setData(model->index(i, headerPosPlace_, modelindex), data);
data = (gamePtr->getEvent()).c_str();
model->setData(model->index(i, headerPosEvent_, modelindex), data);
progressBar_->setValue(i + 1);
}
treeView->setUpdatesEnabled (true);
treeView = new QTreeView;
model = new QStandardItemModel(0,13);
treeView->setModel(model);
void GamesTab::showMatches()
{
treeView->setUpdatesEnabled (false);
modelindex = model->index(0, 0, modelindex);
model->insertRows(0, mainBoard->filteredResults.size(), modelindex);
QVariant data;
QString number =
for (unsigned int i = 0; i < mainBoard->filteredResults.size(); i++) {
int db = mainBoard->filteredResults[i]->dbIndex;
int game = mainBoard->filteredResults[i]->gameIndex;
gamePtr = dbManager_->databases[db]->database->Games[game];
data = (dbManager_->databases[db]->name).c_str();
model->setData(model->index(i, headerPosDatabase_, modelindex), data);
data = (gamePtr->getPlayerW()).c_str();
model->setData(model->index(i, headerPosPlayerWhite_, modelindex), data);
data = (gamePtr->getPlayerB()).c_str();
model->setData(model->index(i, headerPosPlayerBlack_, modelindex), data);
data = (gamePtr->getRankW()).c_str();
model->setData(model->index(i, headerPosRankWhite_, modelindex), data);
data = (gamePtr->getRankB()).c_str();
model->setData(model->index(i, headerPosRankBlack_, modelindex), data);
data = (gamePtr->getResultStr()).c_str();
model->setData(model->index(i, headerPosResult_, modelindex), data);
data = (gamePtr->getKomi()).c_str();
model->setData(model->index(i, headerPosKomi_, modelindex), data);
data = (gamePtr->getDate()).c_str();
model->setData(model->index(i, headerPosDate_, modelindex), data);
data = gamePtr->getMoveCount();
model->setData(model->index(i, headerPosMoveCount_, modelindex), data);
data = (gamePtr->getHandicap()).c_str();
model->setData(model->index(i, headerPosHandicap_, modelindex), data);
data = (gamePtr->getPlace()).c_str();
model->setData(model->index(i, headerPosPlace_, modelindex), data);
data = (gamePtr->getEvent()).c_str();
model->setData(model->index(i, headerPosEvent_, modelindex), data);
progressBar_->setValue(i + 1);
}
treeView->setUpdatesEnabled (true);
To copy to clipboard, switch view to plain text mode
Bookmarks