本文整理汇总了C++中KviPointerList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ KviPointerList::at方法的具体用法?C++ KviPointerList::at怎么用?C++ KviPointerList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviPointerList
的用法示例。
在下文中一共展示了KviPointerList::at方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteCurrent
void LogViewWindow::deleteCurrent()
{
LogListViewItem * pItem = (LogListViewItem *)(m_pListView->currentItem());
if(!pItem)
return;
if(!pItem->childCount())
{
if(!pItem->fileName().isNull())
{
if(QMessageBox::question(
this,
__tr2qs_ctx("Confirm Current User Log Deletion","log"),
__tr2qs_ctx("Do you really wish to delete this log?","log"),
__tr2qs("Yes"),__tr2qs("No"),0,1) != 0)
return;
KviFileUtils::removeFile(pItem->fileName());
delete pItem;
m_pIrcView->clearBuffer();
if(!pItem->parent()->childCount())
delete pItem->parent();
}
return;
}
if(QMessageBox::question(
this,
__tr2qs_ctx("Confirm Current User Logs Deletion","log"),
__tr2qs_ctx("Do you really wish to delete all these logs?","log"),
__tr2qs("Yes"),__tr2qs("No"),0,1) != 0)
return;
KviPointerList<LogListViewItem> itemsList;
itemsList.setAutoDelete(false);
for(int i=0; i < pItem->childCount(); i++)
{
if(!pItem->child(i)->childCount())
{
itemsList.append((LogListViewItem *)pItem->child(i));
continue;
}
LogListViewItem * pChild = (LogListViewItem *)pItem->child(i);
for(int j=0; j < pChild->childCount(); j++)
{
if(!(LogListViewItem *)pChild->child(j))
{
qDebug("Null pointer in logviewitem");
continue;
}
itemsList.append((LogListViewItem *)pChild->child(j));
}
}
for(unsigned int u=0; u < itemsList.count(); u++)
{
LogListViewItem * pCurItem = itemsList.at(u);
if(!pCurItem->fileName().isNull())
KviFileUtils::removeFile(pCurItem->fileName());
}
delete pItem;
}
示例2: exportLog
void LogViewWindow::exportLog(int iId)
{
LogListViewItem * pItem = (LogListViewItem *)(m_pListView->currentItem());
if(!pItem)
return;
if(!pItem->childCount())
{
// Export the log
createLog(pItem->log(), iId);
return;
}
// We selected a node in the log list, scan the children
KviPointerList<LogListViewItem> logList;
logList.setAutoDelete(false);
for(int i = 0; i < pItem->childCount(); i++)
{
if(!pItem->child(i)->childCount())
{
// The child is a log file, append it to the list
logList.append((LogListViewItem *)pItem->child(i));
continue;
}
// The child is a node, scan it
LogListViewItem * pChild = (LogListViewItem *)pItem->child(i);
for(int j=0; j < pChild->childCount(); j++)
{
if(!(LogListViewItem *)pChild->child(j))
{
qDebug("Null pointer in logviewitem");
continue;
}
// Add the child to the list
logList.append((LogListViewItem *)pChild->child(j));
}
}
// Scan the list
for(unsigned int u = 0; u < logList.count(); u++)
{
LogListViewItem * pCurItem = logList.at(u);
createLog(pCurItem->log(), iId);
}
}