本文整理汇总了C++中Savegame::setMarkedCells方法的典型用法代码示例。如果您正苦于以下问题:C++ Savegame::setMarkedCells方法的具体用法?C++ Savegame::setMarkedCells怎么用?C++ Savegame::setMarkedCells使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Savegame
的用法示例。
在下文中一共展示了Savegame::setMarkedCells方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSavegame
// for Savegame
bool Storage::createSavegame(int grp, int lvl, int timespent, int cols_left, int cols_over, QStringList used, QStringList marked)
{
//qDebug() << "createSavegame";
if (! m_db.isOpen()) return false;
bool ret = false;
QDateTime now = QDateTime::currentDateTime();
Savegame *m = new Savegame;
m->created = now.toTime_t();
m->updated = now.toTime_t();
m->grp = grp;
m->lvl = lvl;
m->timespent = timespent;
m->cols_left = cols_left;
m->cols_over = cols_over;
m->setUsedCells(used);
m->setMarkedCells(marked);
QSqlQuery q;
ret = q.prepare("INSERT INTO sg (created, updated, grp, lvl, timespent, cleft, cover, cused, cmarked) "
"VALUES (:created, :updated, :grp, :lvl, :timespent, :cleft, :cover, :cused, :cmarked)");
if (ret) {
q.bindValue(":created", m->created);
q.bindValue(":updated", m->updated);
q.bindValue(":grp", m->grp);
q.bindValue(":lvl", m->lvl);
q.bindValue(":timespent", m->timespent);
q.bindValue(":cleft", m->cols_left);
q.bindValue(":cover", m->cols_over);
q.bindValue(":cused", m->cells_used);
q.bindValue(":cmarked", m->cells_marked);
ret = q.exec();
}
if (ret) m->id = q.lastInsertId().toInt();
//qDebug() << "created with id" << m->id;
return ret;
}