本文整理汇总了C++中QStringList::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringList::remove方法的具体用法?C++ QStringList::remove怎么用?C++ QStringList::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringList
的用法示例。
在下文中一共展示了QStringList::remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeResource
void ManagerImpl::removeResource( Resource *resource )
{
QString key = resource->identifier();
if ( !mConfig ) createStandardConfig();
mConfig->setGroup( "General" );
QStringList activeKeys = mConfig->readListEntry( "ResourceKeys" );
if ( activeKeys.contains( key ) ) {
activeKeys.remove( key );
mConfig->writeEntry( "ResourceKeys", activeKeys );
} else {
QStringList passiveKeys = mConfig->readListEntry( "PassiveResourceKeys" );
passiveKeys.remove( key );
mConfig->writeEntry( "PassiveResourceKeys", passiveKeys );
}
QString standardKey = mConfig->readEntry( "Standard" );
if ( standardKey == key ) {
mConfig->writeEntry( "Standard", "" );
}
mConfig->deleteGroup( "Resource_" + resource->identifier() );
mConfig->sync();
}
示例2:
void
wCatalogEditor::checkUserFields( QStringList &lst)
{
aCfgItem item = md->find(catId);
int fid;
if(item.isNull()) return;
item = md->findChild(item,md_element);
for(int i=0; i< md->count(item,md_field); i++)
{
aCfgItem mdi = md->findChild(item,md_field,i);
int ind = lst.findIndex(QString("uf%1").arg(md->attr(mdi,mda_id)));
if(ind!=-1)
{
lst.insert(lst.at(i),lst[ind]);
lst.remove(lst.at(ind+1));
}
else
{
ind = lst.findIndex(QString("text_uf%1").arg(md->attr(mdi,mda_id)));
if(ind!=-1)
{
lst.insert(lst.at(i),lst[ind]);
lst.remove(lst.at(ind+1));
}
}
}
}
示例3: countDir
bool countDir( const QString& dir ) {
const QString& dot = KGlobal::staticQString( "." );
const QString& dotdot = KGlobal::staticQString( ".." );
QStringList l = QDir(dir).entryList( QDir::All|QDir::Hidden|QDir::System );
l.remove( dot );
l.remove( dotdot );
return countFiles( l, dir );
}
示例4: add
void KRecentDirs::add(const QString &fileClass, const QString &directory)
{
QString key = fileClass;
QStringList result;
KConfig *config = recentdirs_readList(key, result, false);
// make sure the dir is first in history
result.remove(directory);
result.prepend(directory);
while(result.count() > MAX_DIR_HISTORY)
result.remove(result.fromLast());
config->writePathEntry(key, result);
recentdirs_done(config);
}
示例5: Init
void FX_SetupImpl::Init(QStringList c_avail)
{
m_config->setGroup("Effect Stack Configuration");
QStringList conf_active = m_config->readListEntry("Activated");
QStringList c_active;
QStringList::Iterator sit, it;
listBox_Available->clear();
listBox_Active->clear();
c_active.clear();
pushButton_removeAll->setEnabled(false);
for (sit=conf_active.begin(); sit!=conf_active.end(); ++sit){
it = c_avail.find(*sit);
if ( it!=c_avail.end() ){ // active plugin as per config-file in pluginlist found
c_active.append(*sit); // append to active list
c_avail.remove(*sit); // remove active plugin from the list of avail plugins
}
}
if ( !c_active.isEmpty() ){
pushButton_removeAll->setEnabled(true);
}
// Fill ListBoxes
for(it=c_avail.begin(); it!=c_avail.end(); ++it){
listBox_Available->insertItem( (*it), -1 );
}
for(it=c_active.begin(); it!=c_active.end(); ++it){
listBox_Active->insertItem( (*it), -1 );
}
}
示例6: restoreLayout
void BaseTreeView::restoreLayout(KConfig *config, const QString &group)
{
KListView::restoreLayout(config, group);
KConfigGroupSaver saver(config, group);
setShowToolTips( config->readBoolEntry("ShowToolTips", true) );
if (! m_saveOpenFolder || ! qConfig.saveTrees)
return;
BaseTreeBranch *btb;
KFileTreeBranchIterator it( branches() );
int maxBranch = config->readNumEntry("NumOpenFolderList", 0);
for (int i = 1; i <= maxBranch; ++i)
{
QStringList folderList = QuantaCommon::readPathListEntry(config, "OpenFolderList" + QString::number(i));
if (folderList.count() > 1) {
KURL rootURL = (*folderList.begin());
folderList.remove(folderList.begin()); // remove the root URL
KFileTreeBranchIterator it( branches() );
for ( ; it.current(); ++it)
{
if ((*it)->rootUrl() == rootURL) {
btb = dynamic_cast<BaseTreeBranch *>( (*it) );
if (btb) {
btb->folderToOpen = folderList;
btb->reopenFolder();
break;
}
}
}
}
}
}
示例7: addEntry
static void addEntry(QStringList &list, const QString &name, const QString &file, const QString &fmapDir)
{
QString existing(getEntry(list, name));
bool insert = true;
if(!existing.isEmpty())
if(isAlias(existing))
list.remove(existing);
else
insert = false;
if(insert)
{
QString entry;
QTextOStream str(&entry);
str << '/' << name << " (";
if(0 == file.find(fmapDir))
str << file.mid(fmapDir.length());
else
str << file;
str << ") ;";
list.append(entry);
}
}
示例8: addHistory
void JabberBrowser::addHistory(const QString &str)
{
QStringList l;
QString h = m_client->getBrowserHistory();
while (h.length()){
l.append(getToken(h, ';'));
}
QStringList::Iterator it;
for (it = l.begin(); it != l.end(); ++it){
if (*it == str){
l.remove(it);
break;
}
}
l.prepend(str);
QString res;
Command cmd;
cmd->id = static_cast<JabberPlugin*>(m_client->protocol()->plugin())->CmdUrl;
cmd->param = this;
Event eWidget(EventCommandWidget, cmd);
CToolCombo *cmbUrl = (CToolCombo*)(eWidget.process());
if (cmbUrl)
cmbUrl->clear();
unsigned i = 0;
for (it = l.begin(); it != l.end(); ++it){
if (i++ > MAX_HISTORY)
break;
if (!res.isEmpty())
res += ";";
cmbUrl->insertItem(*it);
res += quoteChars(*it, ";");
}
m_client->setBrowserHistory(res);
}
示例9: slotBushuSelected
void BushuViewWidget::slotBushuSelected( QListViewItem *item )
{
if ( !item )
return ;
QString selectedBushuName = item->text( 0 );
if ( selectedBushuName.isEmpty() )
return ;
QFile file( BUSHUDICT );
if ( file.open( IO_ReadOnly ) )
{
QTextStream stream( &file );
stream.setCodec(QTextCodec::codecForName(BUSHUDICT_ENCODING));
QString line;
// search selected bushu line by line
while ( !stream.atEnd() )
{
QStringList chars = QStringList::split( " ", stream.readLine() );
QString bushuName = chars[ 0 ];
if ( selectedBushuName == bushuName )
{
// Display Characters
chars.remove( bushuName );
m_charGridView->setCharacters( chars );
}
}
file.close();
}
}
示例10: KURL
KURL *decodeImgDrop(QDropEvent *e, QWidget *wdg)
{
KURL::List uris;
if (KURLDrag::decode(e, uris) && (uris.count() > 0)) {
KURL *url = new KURL(uris.first());
KImageIO::registerFormats();
if( KImageIO::canRead(KImageIO::type(url->fileName())) )
return url;
QStringList qs = QStringList::split('\n', KImageIO::pattern());
qs.remove(qs.begin());
QString msg = i18n( "%1 "
"does not appear to be an image file.\n"
"Please use files with these extensions:\n"
"%2")
.arg(url->fileName())
.arg(qs.join("\n"));
KMessageBox::sorry( wdg, msg);
delete url;
}
return 0;
}
示例11: removeEmail
void OPimContact::removeEmail( const QString &v )
{
QString e = v.simplifyWhiteSpace();
QString def = defaultEmail();
QString emailsStr = find( Qtopia::Emails );
QStringList emails = emailList();
// otherwise, must first contain it
if ( !emailsStr.contains( e ) )
return ;
// remove it
//odebug << " removing email from list " << e << "" << oendl;
emails.remove( e );
// reset the string
emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator
replace( Qtopia::Emails, emailsStr );
// if default, then replace the default email with the first one
if ( def == e )
{
//odebug << "removeEmail is default; setting new default" << oendl;
if ( !emails.count() )
clearEmails();
else // setDefaultEmail will remove e from the list
setDefaultEmail( emails.first() );
}
}
示例12: doRollBack
void addBackEnd::doRollBack()
{
if (KMessageBox::warningContinueCancel(m_parent, i18n("<qt>This removes all your entries from the sidebar and adds the system default ones.<BR><B>This procedure is irreversible</B><BR>Do you want to proceed?</qt>"))==KMessageBox::Continue)
{
KStandardDirs *dirs = KGlobal::dirs();
QString loc=dirs->saveLocation("data","konqsidebartng/" + m_currentProfile + "/",true);
QDir dir(loc);
QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks );
dirEntries.remove(".");
dirEntries.remove("..");
for ( QStringList::Iterator it = dirEntries.begin(); it != dirEntries.end(); ++it ) {
if ((*it)!="add")
KIO::NetAccess::del(KURL( loc+(*it) ), m_parent);
}
emit initialCopyNeeded();
}
}
示例13: writeResourceConfig
void ManagerImpl::writeResourceConfig( Resource *resource, bool checkActive )
{
QString key = resource->identifier();
kdDebug(5650) << "Saving resource " << key << endl;
if ( !mConfig ) createStandardConfig();
mConfig->setGroup( "Resource_" + key );
resource->writeConfig( mConfig );
mConfig->setGroup( "General" );
QString standardKey = mConfig->readEntry( "Standard" );
if ( resource == mStandard && standardKey != key )
mConfig->writeEntry( "Standard", resource->identifier() );
else if ( resource != mStandard && standardKey == key )
mConfig->writeEntry( "Standard", "" );
if ( checkActive ) {
QStringList activeKeys = mConfig->readListEntry( "ResourceKeys" );
QStringList passiveKeys = mConfig->readListEntry( "PassiveResourceKeys" );
if ( resource->isActive() ) {
if ( passiveKeys.contains( key ) ) { // remove it from passive list
passiveKeys.remove( key );
mConfig->writeEntry( "PassiveResourceKeys", passiveKeys );
}
if ( !activeKeys.contains( key ) ) { // add it to active list
activeKeys.append( key );
mConfig->writeEntry( "ResourceKeys", activeKeys );
}
} else if ( !resource->isActive() ) {
if ( activeKeys.contains( key ) ) { // remove it from active list
activeKeys.remove( key );
mConfig->writeEntry( "ResourceKeys", activeKeys );
}
if ( !passiveKeys.contains( key ) ) { // add it to passive list
passiveKeys.append( key );
mConfig->writeEntry( "PassiveResourceKeys", passiveKeys );
}
}
}
mConfig->sync();
}
示例14: caList
QStringList KSSLD::caList() {
QStringList x;
KConfig cfg("ksslcalist", true, false);
x = cfg.groupList();
x.remove("<default>");
return x;
}
示例15: largeFont
QFont KGlobalSettings::largeFont(const QString &text)
{
QFontDatabase db;
QStringList fam = db.families();
// Move a bunch of preferred fonts to the front.
if (fam.remove("Arial"))
fam.prepend("Arial");
if (fam.remove("Verdana"))
fam.prepend("Verdana");
if (fam.remove("Tahoma"))
fam.prepend("Tahoma");
if (fam.remove("Lucida Sans"))
fam.prepend("Lucida Sans");
if (fam.remove("Lucidux Sans"))
fam.prepend("Lucidux Sans");
if (fam.remove("Nimbus Sans"))
fam.prepend("Nimbus Sans");
if (fam.remove("Gothic I"))
fam.prepend("Gothic I");
if (_largeFont)
fam.prepend(_largeFont->family());
for(QStringList::ConstIterator it = fam.begin();
it != fam.end(); ++it)
{
if (db.isSmoothlyScalable(*it) && !db.isFixedPitch(*it))
{
QFont font(*it);
font.setPixelSize(75);
QFontMetrics metrics(font);
int h = metrics.height();
if ((h < 60) || ( h > 90))
continue;
bool ok = true;
for(unsigned int i = 0; i < text.length(); i++)
{
if (!metrics.inFont(text[i]))
{
ok = false;
break;
}
}
if (!ok)
continue;
font.setPointSize(48);
_largeFont = new QFont(font);
return *_largeFont;
}
}
_largeFont = new QFont(KGlobalSettings::generalFont());
_largeFont->setPointSize(48);
return *_largeFont;
}