本文整理汇总了C++中QStringList::rend方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringList::rend方法的具体用法?C++ QStringList::rend怎么用?C++ QStringList::rend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringList
的用法示例。
在下文中一共展示了QStringList::rend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cDebug
void
KeyboardPage::guessLayout( const QStringList& langParts )
{
const KeyboardLayoutModel* klm = dynamic_cast< KeyboardLayoutModel* >( ui->listLayout->model() );
bool foundCountryPart = false;
for ( auto countryPart = langParts.rbegin(); !foundCountryPart && countryPart != langParts.rend(); ++countryPart )
{
cDebug() << " .. looking for locale part" << *countryPart;
for ( int i = 0; i < klm->rowCount(); ++i )
{
QModelIndex idx = klm->index( i );
QString name = idx.isValid() ? idx.data( KeyboardLayoutModel::KeyboardLayoutKeyRole ).toString() : QString();
if ( idx.isValid() && ( name.compare( *countryPart, Qt::CaseInsensitive ) == 0 ) )
{
cDebug() << " .. matched" << name;
ui->listLayout->setCurrentIndex( idx );
foundCountryPart = true;
break;
}
}
if ( foundCountryPart )
{
++countryPart;
if ( countryPart != langParts.rend() )
{
cDebug() << "Next level:" << *countryPart;
for (int variantnumber = 0; variantnumber < ui->listVariant->count(); ++variantnumber)
{
LayoutItem *variantdata = dynamic_cast< LayoutItem* >( ui->listVariant->item( variantnumber ) );
if ( variantdata && (variantdata->data.compare( *countryPart, Qt::CaseInsensitive ) == 0) )
{
ui->listVariant->setCurrentItem( variantdata );
cDebug() << " .. matched variant" << variantdata->data << ' ' << variantdata->text();
}
}
}
}
}
}
示例2: postProcessBaseClasses
void ClassAnalyzer::postProcessBaseClasses()
{
// append namespace prefixes if needed
for (auto it = m_classes.begin(); it != m_classes.end(); it++)
{
if (!it->baseClasses().isEmpty())
{
QStringList baseClasses = it->baseClasses();
for (auto it2 = baseClasses.begin(); it2 != baseClasses.end(); it2++)
{
QStringList splittedBaseClassName = it2->split("::");
for (auto it3 = m_classes.begin(); it3 != m_classes.end(); it3++)
{
QStringList splittedClassName = it3->name().split("::");
// check from back to front
if (splittedClassName.last() == splittedBaseClassName.last())
{
QString fullName = splittedClassName.last();
splittedClassName.removeLast();
QStringList splitted = it->name().split("::");
while(!splitted.isEmpty())
{
splitted.removeLast();
if (splittedClassName == splitted)
{
for (auto it4 = splitted.rbegin(); it4 != splitted.rend(); it4++)
{
fullName.prepend("::");
fullName.prepend(*it4);
}
break;
}
}
*it2 = fullName;
}
}
}
it->setBaseClasses(baseClasses);
}
}
}