本文整理汇总了C++中QMessageIdList::removeAt方法的典型用法代码示例。如果您正苦于以下问题:C++ QMessageIdList::removeAt方法的具体用法?C++ QMessageIdList::removeAt怎么用?C++ QMessageIdList::removeAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMessageIdList
的用法示例。
在下文中一共展示了QMessageIdList::removeAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filterMessages
void MessagingHelper::filterMessages(QMessageIdList& messageIds, const QMessageFilter& filter)
{
if (messageIds.count() && !filter.isEmpty()) {
QMessageFilterPrivate* pf = QMessageFilterPrivate::implementation(filter);
if ((pf->_field == QMessageFilterPrivate::None) &&
(pf->_filterList.count() == 0)) {
if (pf->_notFilter) {
// There is only one filter: empty ~QMessageFilter()
// => accountIds must be cleared
messageIds.clear();
return;
} else {
// There is only one filter: empty QMessageFilter()
// => accountIds list can remain intact
return;
}
}
if (pf->_valid) {
QMessageStore* store = QMessageStore::instance();
for (int i=messageIds.count()-1; i >= 0; i--) {
QMessage message = store->message(messageIds[i]);
if (!pf->filter(message)) {
messageIds.removeAt(i);
}
}
}
}
}
示例2: applyOffsetAndLimitToMessageIdList
void MessagingHelper::applyOffsetAndLimitToMessageIdList(QMessageIdList& messageIds, int limit, int offset)
{
if (messageIds.count() == 0) {
return;
}
if (offset > 0) {
if (offset > messageIds.count()) {
messageIds.clear();
} else {
for (int i = 0; i < offset; i++) {
messageIds.removeFirst();
}
}
}
if (limit > 0) {
for (int i = messageIds.count()-1; i >= limit; i--) {
messageIds.removeAt(i);
}
}
}