本文整理汇总了C++中QDir::setMatchAllDirs方法的典型用法代码示例。如果您正苦于以下问题:C++ QDir::setMatchAllDirs方法的具体用法?C++ QDir::setMatchAllDirs怎么用?C++ QDir::setMatchAllDirs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDir
的用法示例。
在下文中一共展示了QDir::setMatchAllDirs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dir
QStringList * zEmotIcons::getSmilePackList()
{
QStringList * list = new QStringList();
QDir dir ( ProgDir+"smile/", "", QDir::Name | QDir::DirsFirst | QDir::IgnoreCase );
#ifdef OLD_SDK
dir.setMatchAllDirs ( true );
#endif
dir.setFilter ( QDir::Dirs );
if ( !dir.isReadable() )
return list;
QStringList entries = dir.entryList();
for ( QStringList::ConstIterator it = entries.begin(); it != entries.end(); it++ )
if ( (*it)[0] != "." )
list->append(*it);
return list;
}
示例2: lookForDefinitions
static void lookForDefinitions( const QString& dir, const QString& filter, MetaTranslator* tor, fetchFunctor fetchtr )
{
QDir d ( dir );
d.setFilter( QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks );
d.setNameFilter( filter );
d.setSorting( QDir::Name );
d.setMatchAllDirs( true );
const QFileInfoList *list = d.entryInfoList();
QFileInfoListIterator it( *list );
QFileInfo *fi;
for ( ; ( fi = it.current() ) != 0; ++it )
{
// skip "." and ".." dir
if ( fi->isDir() && ( fi->fileName() == "." || fi->fileName() == ".." ) )
continue;
else if ( fi->isDir() )
lookForDefinitions( d.absPath() + "/" + fi->fileName(), filter, tor, fetchtr );
else
{
fetchtr( dir + "/" + fi->fileName(), tor, 0, true );
}
}
}
示例3: CargarBrowser
void ZFileOpenDialog::CargarBrowser(QString direccion)
{
browser->clear();
QDir dir ( direccion, "*" );
sPath = direccion;
dir.setMatchAllDirs ( true );
dir.setFilter ( QDir::Dirs | QDir::Hidden );
if ( !dir.isReadable() )
return;
QStringList entries = dir.entryList();
entries.sort();
QStringList::ConstIterator it = entries.begin();
QPixmap pixmap;
if ( (sPath != "") && (sPath != "/") && (sPath != "//") )
{
pixmap=QPixmap( iconReader2.getIcon("gen_back_to_arrw_thb", false) );
if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage();
image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); }
ZListBoxItem* Item;
Item = new ZListBoxItem ( browser, QString ( "%I%M" ) );
Item->setPixmap ( 0, pixmap ); Item->appendSubItem ( 1, "..", false, NULL );
browser->insertItem ( Item,-1,true );
}
while ( it != entries.end() ) {
if ( ( *it != "." ) && ( *it != ".." ) )
{
pixmap=QPixmap( iconReader2.getIcon("fm_folder_small", false) );
if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage();
image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); }
ZListBoxItem* Item;
Item = new ZListBoxItem ( browser, QString ( "%I%M" ) );
Item->setPixmap ( 0, pixmap );
Item->appendSubItem ( 1, *it, false, NULL );
browser->insertItem ( Item,-1,true );
}
++it;
}
dir.setFilter ( QDir::Files | QDir::Hidden );
entries = dir.entryList();
entries.sort();
it = entries.begin();
while ( it != entries.end() ) {
pixmap=QPixmap( iconReader2.getIcon("msg_receipt_request_small", false) );
if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage();
image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); }
ZListBoxItem* Item;
Item = new ZListBoxItem ( browser, QString ( "%I%M" ) );
Item->setPixmap ( 0, pixmap );
Item->appendSubItem ( 1, *it, false, NULL );
browser->insertItem ( Item,-1,true );
++it;
}
}