当前位置: 首页>>代码示例>>C++>>正文


C++ QStrList::append方法代码示例

本文整理汇总了C++中QStrList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QStrList::append方法的具体用法?C++ QStrList::append怎么用?C++ QStrList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QStrList的用法示例。


在下文中一共展示了QStrList::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readListConf

int readListConf ( KConfig *conf, QString key, QStrList &list )
{
  if( !conf->hasKey( key ) )
    { 
      // debug("readListConf:: key does not exist");
      return 0;
    }
  QString str_list, value;
  str_list = conf->readEntry(key);
  if(str_list.isEmpty())
    {
      // debug("readListConf:: list is empty"); 
      return 0; 
    }
  list.clear();
  int i;
  int len = str_list.length();
  for( i = 0; i < len; i++ )
    {
      if( str_list[i] != ',' && str_list[i] != '\\' )
	{
	  value += str_list[i];
	  continue;
	}
      if( str_list[i] == '\\' )
	{
	  i++;
	  value += str_list[i];
	  continue;
	}
      list.append(value);
      value.truncate(0);
    }
  list.append(value);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:35,代码来源:ReadListConf.cpp

示例2: allObjects

QStrList objFinder::allObjects(){ /*fold00*/
  QStrList allNames;
  QDictIterator<QObject> it(*objList);
  while(it.current()){
    QObjectList *qobl = it.current()->queryList(); // Matches everything
    QObjectListIt itql( *qobl );
    while(itql.current()){
      QString name;
      name = itql.current()->className();
      name += "::";
      name += itql.current()->name("unnamed");
      allNames.append(name);
      ++itql;
    }
    delete qobl;
    ++it;
  }
  QWidgetList *all = QApplication::allWidgets();
  QWidgetListIt itW(*all);
  while(itW.current()){
    QString name;
    name = itW.current()->className();
    name += "::";
    name += itW.current()->name("unnamed");
    allNames.append(name);
    ++itW;
  }
  delete all;
  return allNames;
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:30,代码来源:objFinder.cpp

示例3: getData

void CDDBSetup::getData(QStrList& _serverlist,
                        QStrList& _submitlist,
			QString& _basedir,
			QString& _submitaddress, 
			QString& _current_server,
			bool&    remote_enabled,
			bool&    http_proxy_enabled,
			QString  &http_proxy_host,
			int      &http_proxy_port)
{
    uint i;

    _serverlist.clear();
    _submitlist.clear();
    for(i = 0; i < server_listbox->count();i++){
        _serverlist.append(server_listbox->text(i));
    }
    for(i = 0; i < submission_listbox->count(); i++){
        _submitlist.append(submission_listbox->text(i));
    }
    _basedir = basedirstring.copy();
    _submitaddress = submitaddressstring.copy();

    _current_server     = current_server_string.copy();
    remote_enabled      = remote_cddb_cb->isChecked();
    http_proxy_enabled  = cddb_http_cb->isChecked();
    http_proxy_host     = proxy_host_ef->text();
    http_proxy_port     = atoi(proxy_port_ef->text());
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:29,代码来源:CDDBSetup.cpp

示例4: x

ac::ac(const QString &changes, QWidget *parent, const char *name, const QStringList &)
:AcDialog(parent, name)
{

	borderFrame->hide();
	setGeometry( x(), y(), 500, 30);
	borderFrame->setGeometry( 0, 0, 500, 400);
	konsoleFrame->setGeometry( 0, 0, 500, 400);

	appdir   = "/usr/share/apt-get-konsole/";

	loadKonsole();
	konsoleFrame->installEventFilter( this );

	changes2 = changes;

	QStrList run;
	run.append( appdir+"sh/applyChanges" );

	run.append( changes );

	// run command
	terminal()->startProgram( appdir+"sh/applyChanges", run );

	j=0;
	firstdownload = TRUE;

	connect( konsole, SIGNAL( receivedData( const QString& ) ), SLOT( shellOutput( const QString&) ) );
	connect( konsole, SIGNAL( destroyed() ), SLOT( close() ) );
}
开发者ID:fullstory-morgue,项目名称:sidux-edu,代码行数:30,代码来源:ac.cpp

示例5: slotCopyClients

void KFMServer::slotCopyClients( const char *_src_urls, const char *_dest_url )
{
    QString s = _src_urls;
    s.detach();
    QStrList urlList;

    QString dest = _dest_url;
    if ( dest == "trash:/" )
        dest = "file:" + KFMPaths::TrashPath();

    int i;
    while ( ( i = s.find( "\n" ) ) != -1 )
    {
        QString t = s.left( i );
        urlList.append( t.data() );
        s = s.mid( i + 1, s.length() );
    }

    urlList.append( s.data() );

    KIOJob *job = new KIOJob();
    if ( urlList.count() == 1 )
        job->copy( urlList.first(), dest.data() );
    else
        job->copy( urlList, dest.data() );
}
开发者ID:xwizard,项目名称:kde1,代码行数:26,代码来源:kfmserver.cpp

示例6: slotExec

void KFMServer::slotExec( const char* _url, const char * _documents )
{
    KURL u( _url );
    if ( u.isMalformed() )
    {
        QString msg;
        ksprintf(&msg, i18n( "The URL\n%s\nis malformed" ),
                 _url);
        QMessageBox::warning( (QWidget*)0,
                              i18n( "KFM Error" ), msg );
        return;
    }

    if ( _documents == 0L && _url != 0L )
    {
        KFMExec *e = new KFMExec;
        e->openURL( _url );
        return;
    }

    QString s( _documents );
    QStrList urlList;

    int i;
    while ( ( i = s.find( "\n" ) ) != -1 )
    {
        QString t = s.left( i );
        urlList.append( t.data() );
        s = s.mid( i + 1, s.length() );
    }

    urlList.append( s.data() );
    KMimeType *typ = KMimeType::getMagicMimeType( _url );
    typ->runAsApplication( _url, &urlList );
}
开发者ID:xwizard,项目名称:kde1,代码行数:35,代码来源:kfmserver.cpp

示例7: decode

/*!
  Decodes URLs from \a e, placing the result in \a l (which is first cleared).

  Returns TRUE if the event contained a valid list of URLs.
*/
bool QUrlDrag::decode( QDropEvent* e, QStrList& l )
{
    QByteArray payload = e->data( "url/url" );
    if ( payload.size() ) {
	e->accept();
	l.clear();
	l.setAutoDelete(TRUE);
	uint c=0;
	char* d = payload.data();
	while (c < payload.size()) {
	    uint f = c;
	    while (c < payload.size() && d[c])
		c++;
	    if ( c < payload.size() ) {
		l.append( d+f );
		c++;
	    } else {
		QString s(d+f,c-f+1);
		l.append( s );
	    }
	}
	return TRUE;
    }
    return FALSE;
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:30,代码来源:qdragobject.cpp

示例8: slotMove

void KFMClient::slotMove( const char *_src_urls, const char *_dest_url )
{
    QString s = _src_urls;
    s.detach();
    QStrList urlList;

    QString dest = _dest_url;
    if ( dest == "trash:/" )
        dest = "file:" + KFMPaths::TrashPath();

    int i;
    while ( ( i = s.find( "\n" ) ) != -1 )
    {
        QString t = s.left( i );
        urlList.append( t.data() );
        s = s.mid( i + 1, s.length() );
    }

    urlList.append( s.data() );

    KIOJob *job = new KIOJob();
    connect( job, SIGNAL( finished( int ) ), this, SLOT( finished( int ) ) );
    if ( urlList.count() == 1 )
        job->move( urlList.first(), dest.data() );
    else
        job->move( urlList, dest.data() );
}
开发者ID:xwizard,项目名称:kde1,代码行数:27,代码来源:kfmserver.cpp

示例9: cddb_playlist_decode

bool cddb_playlist_decode(QStrList& list, QString& str){
 
    bool isok = true;
    int pos1, pos2;
    pos1 = 0;
    pos2 = 0;

    list.clear();

    while((pos2 = str.find(",",pos1,true)) != -1){

	if(pos2 > pos1){
	    list.append(str.mid(pos1,pos2 - pos1));
	}
    
	pos1 = pos2 + 1;
    }
  
    if(pos1 <(int) str.length())
	list.append(str.mid(pos1,str.length()));

    QString check;
    bool 	ok1;
    int   num;

    for(uint i = 0; i < list.count(); i++){
	check = list.at(i);
	check = check.stripWhiteSpace();

	if(check.isEmpty()){
	    list.remove(i);
	    i--;
	    continue;
	}

	if(check == QString (",")){
	    list.remove(i);
	    i--;
	    continue;
	}
    
	num = check.toInt(&ok1);
	if(!ok1 || num < 1){
	    list.remove(i);
	    i--;
	    isok = false;
	    continue;
	}
    
	list.remove(i);
	list.insert(i, check);

    }

    /*  for(uint i = 0; i < list.count(); i++){
	printf("playlist %d=%s\n",i,list.at(i));
	}*/
    return isok;
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:59,代码来源:cddb.cpp

示例10: fileSaveAs

void Kooka::fileSaveAs()
{
    // this slot is called whenever the File->Save As menu is selected,
   QStrList strlist;
   strlist.append( "BMP" );
   strlist.append( "JPEG" );
   FormatDialog fd( 0, "FormatDialog", &strlist );
   fd.exec();

}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:10,代码来源:kooka.cpp

示例11: projectOpened

void RubySupportPart::projectOpened()
{
  kdDebug() << "projectOpened()" << endl;

  QStrList l;
  l.append( shell().latin1() ) ;
  m_shellWidget->setShell( shell().latin1(), l );
  m_shellWidget->activate();
  m_shellWidget->setAutoReactivateOnClose( true );

  connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
  	this, SLOT(addedFilesToProject(const QStringList &)) );
  connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
  	this, SLOT(removedFilesFromProject(const QStringList &)) );

  QFileInfo program(mainProgram());

  // If it's a Rails project, create the project files if they're missing
  if (mainProgram().endsWith("script/server")) {
    QString cmd;
    QFileInfo server(project()->projectDirectory() + "/script/server");
    if (! server.exists()) {
      cmd += "rails " + project()->projectDirectory();
      if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
        appFrontend->startAppCommand(project()->projectDirectory(), cmd, false);
    }
  }

  // We want to parse only after all components have been
  // properly initialized
  QTimer::singleShot(0, this, SLOT(initialParse()));
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:32,代码来源:rubysupport_part.cpp

示例12: saveGroup

void 
KAMenu::slotHostlistChanged()
{
  /* die Liste der erreichbaren Archiehosts hat sich
   * veraendert. neu einlesen
   */
  //  KConfig *config = KApplication::getKApplication()->getConfig();
  QStrList archiehostlist;
  //  int archiehostlistnumber = 
  KConfigGroupSaver saveGroup( config, "HostConfig" );

  config->readListEntry( "Hosts", archiehostlist );
  //  QString currenthost = config->readEntry( "CurrentHost", "archie.sura.net" );
  QString defaulthost = "archie.sura.net" ;
  if ( archiehostlist.isEmpty() ) {
    archiehostlist.append( defaulthost );
    //    currentHostId = 0;
  }
  
  host->clear();
  char *tmpStr;
  int i = 0;
  for (tmpStr=archiehostlist.first(); tmpStr; tmpStr=archiehostlist.next()) {
    host->insertItem( tmpStr, i, i);
    i++;
  }

  slotConfigChanged();

  emit sigArchieHost(host->text(host_id));
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:31,代码来源:KAMenu.cpp

示例13: buildDatumMenu

void ossimQtQuadProjectionController::buildDatumMenu() const
{
   // Build the datum menu.
   QStrList datumList;
   std::vector<ossimString> tempOssimDatumList =
      ossimDatumFactory::instance()->getList();
   std::vector<ossimString>::iterator listIter = tempOssimDatumList.begin();
   while(listIter != tempOssimDatumList.end())
   {
      const ossimDatum* datum = ossimDatumFactory::instance()->
         create(*listIter);
      if(datum)
      {
         datumList.append((datum->code() + ": " + datum->name()).c_str());
      }
      ++listIter;
   }
   theDialog->theDatumComboBox->clear();
   theDialog->theDatumComboBox->insertStrList(datumList);

   // Set to WGE for default (WGS-84).
   const int COUNT = theDialog->theDatumComboBox->count();
   for (int i = 0; i < COUNT; ++i)
   {
      ossimString name = theDialog->theDatumComboBox->text(i).ascii();
      
      if (name.contains("WGE"))
      {
         theDialog->theDatumComboBox->setCurrentItem(i);
         break;
      }
   }   
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:33,代码来源:ossimQtQuadProjectionController.cpp

示例14: decode

/*!
  Decodes URIs from \a e, placing the result in \a l (which is first cleared).

  Returns TRUE if the event contained a valid list of URIs.
*/
bool QUriDrag::decode( const QMimeSource* e, QStrList& l )
{
    QByteArray payload = e->encodedData( "text/uri-list" );
    if ( payload.size() ) {
	l.clear();
	l.setAutoDelete(TRUE);
	uint c=0;
	char* d = payload.data();
	while (c < payload.size() && d[c]) {
	    uint f = c;
	    // Find line end
	    while (c < payload.size() && d[c] && d[c]!='\r'
		    && d[c] != '\n')
		c++;
	    QCString s(d+f,c-f+1);
	    if ( s[0] != '#' ) // non-comment?
		l.append( s );
	    // Skip junk
	    while (c < payload.size() && d[c] &&
		    (d[c]=='\n' || d[c]=='\r'))
		c++;
	}
	return TRUE;
    }
    return FALSE;
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:31,代码来源:qdragobject.cpp

示例15: setFilenames

/*!
  Sets the URIs to be the local-file URIs equivalent to \a fnames.

  \sa localFileToUri(), setUris()
*/
void QUriDrag::setFilenames( QStringList fnames )
{
    QStrList uris;
    for (QStringList::Iterator i = fnames.begin();
	    i != fnames.end(); ++i )
	uris.append(localFileToUri(*i));
    setUris(uris);
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:13,代码来源:qdragobject.cpp


注:本文中的QStrList::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。