本文整理汇总了C++中FinishedTransfersItem::row方法的典型用法代码示例。如果您正苦于以下问题:C++ FinishedTransfersItem::row方法的具体用法?C++ FinishedTransfersItem::row怎么用?C++ FinishedTransfersItem::row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FinishedTransfersItem
的用法示例。
在下文中一共展示了FinishedTransfersItem::row方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remUser
void FinishedTransfersModel::remUser(const QString &cid){
FinishedTransfersItem *item = findUser(cid);
if (!item)
return;
user_hash.remove(cid);
beginRemoveRows(QModelIndex(), item->row(), item->row());
{
userItem->childItems.removeAt(item->row());
delete item;
}
endRemoveRows();
}
示例2: remFile
void FinishedTransfersModel::remFile(const QString &file){
FinishedTransfersItem *item = findFile(file);
if (!item)
return;
file_hash.remove(file);
beginRemoveRows(QModelIndex(), item->row(), item->row());
{
fileItem->childItems.removeAt(item->row());
delete item;
}
endRemoveRows();
}
示例3: addFile
void FinishedTransfersModel::addFile(const QMap<QString, QVariant> ¶ms){
FinishedTransfersItem *item = findFile(params["TARGET"].toString());
if (!item)
return;
for (int i = 0; i < fileItem->columnCount(); i++){
if (file_header_table[i] == "USERS"){
QStringList users = params[file_header_table[i]].toString().split(" ");
QStringList old_users = item->data(i).toString().split(" ");
if (users.isEmpty())
continue;
else{
for (const auto nick : users){
if (!old_users.contains(nick))
old_users.push_back(nick);
}
item->updateColumn(i, old_users.join(" "));
}
}
else
item->updateColumn(i, params[file_header_table[i]]);
}
emit dataChanged(createIndex(item->row(), COLUMN_FINISHED_NAME, item), createIndex(item->row(), COLUMN_FINISHED_FULL, item));
}
示例4: addUser
void FinishedTransfersModel::addUser(const QMap<QString, QVariant> ¶ms){
FinishedTransfersItem *item = findUser(params["CID"].toString());
if (!item)
return;
for (int i = 0; i < userItem->columnCount(); i++){
if (user_header_table[i] == "NICK"){
QString user = params[user_header_table[i]].toString();
if (user.trimmed().isEmpty() || user.trimmed().isNull())
continue;
else
item->updateColumn(i, user);
}
else
item->updateColumn(i, params[user_header_table[i]]);
}
emit dataChanged(createIndex(item->row(), COLUMN_FINISHED_NAME, item), createIndex(item->row(), COLUMN_FINISHED_CRC32, item));
}