本文整理汇总了C++中Shared::getFileFilters方法的典型用法代码示例。如果您正苦于以下问题:C++ Shared::getFileFilters方法的具体用法?C++ Shared::getFileFilters怎么用?C++ Shared::getFileFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shared
的用法示例。
在下文中一共展示了Shared::getFileFilters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Register
void FileIOFilter::Register(Shared filter)
{
if (!filter)
{
assert(false);
return;
}
//filters are uniquely recognized by their 'file filter' string
QStringList fileFilters = filter->getFileFilters(true);
QString filterName = filter->getDefaultExtension().toUpper();
for (FilterContainer::const_iterator it=s_ioFilters.begin(); it!=s_ioFilters.end(); ++it)
{
bool error = false;
if (*it == filter)
{
ccLog::Warning(QString("[FileIOFilter::Register] I/O filter '%1' is already registered").arg(filterName));
error = true;
}
else
{
//we are going to compare the file filters as they should remain unique!
QStringList otherFilters = (*it)->getFileFilters(true);
for (int i=0; i<fileFilters.size(); ++i)
{
if (otherFilters.contains(fileFilters[i]))
{
QString otherFilterName = (*it)->getDefaultExtension().toUpper();;
ccLog::Warning(QString("[FileIOFilter::Register] Internal error: file filter '%1' of filter '%2' is already handled by another filter ('%3')!").arg(fileFilters[i]).arg(filterName).arg(otherFilterName));
error = true;
break;
}
}
}
if (error)
return;
}
//insert filter
s_ioFilters.push_back(filter);
}