本文整理汇总了C++中TrackId::toVariant方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackId::toVariant方法的具体用法?C++ TrackId::toVariant怎么用?C++ TrackId::toVariant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackId
的用法示例。
在下文中一共展示了TrackId::toVariant方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query
QList<AnalysisDao::AnalysisInfo> AnalysisDao::getAnalysesForTrack(TrackId trackId) {
if (!m_db.isOpen() || !trackId.isValid()) {
return QList<AnalysisInfo>();
}
QSqlQuery query(m_db);
query.prepare(QString(
"SELECT id, type, description, version, data_checksum FROM %1 "
"WHERE track_id=:trackId").arg(s_analysisTableName));
query.bindValue(":trackId", trackId.toVariant());
return loadAnalysesFromQuery(trackId, &query);
}
示例2: deleteAnalysesForTrack
bool AnalysisDao::deleteAnalysesForTrack(TrackId trackId) {
if (!trackId.isValid()) {
return false;
}
QSqlQuery query(m_db);
query.prepare(QString(
"SELECT id FROM %1 where track_id = :track_id").arg(s_analysisTableName));
query.bindValue(":track_id", trackId.toVariant());
if (!query.exec()) {
LOG_FAILED_QUERY(query) << "couldn't delete analyses for track" << trackId;
return false;
}
QList<int> analysesToDelete;
const int idColumn = query.record().indexOf("id");
while (query.next()) {
analysesToDelete.append(
query.value(idColumn).toInt());
}
foreach (int analysisId, analysesToDelete) {
deleteAnalysis(analysisId);
}