Ejemplo n.º 1
0
void ZFonts::fillFontsByDir(QString sDir)
{
	QStringList slFonts;
	slFonts.clear();
	QDir dir( sDir );
	dir.setFilter( QDir::Files );
	dir.setNameFilter("*.ttf;*.TTF");
	slFonts = dir.entryList();
	
	QString * path;
	QPixmap pm( ProgDir + "/fonts.png");
	for ( QStringList::Iterator it = slFonts.begin(); it != slFonts.end(); ++it ) 
	{
		ZSettingItem* item = new ZSettingItem(lbFonts, "%I%M");
		item->setPixmap( 0, pm  );
		item->appendSubItem( 1, QString::fromUtf8(*it) );
		path = new QString(sDir+"/"+(*it));
		item->setReservedData( (int)path );
		lbFonts->insertItem( item );      
	}
}