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


C++ QListIterator类代码示例

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


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

示例1: SaXManipulateDesktop

//====================================
// init
//------------------------------------
void SCCMonitorDualModel::init ( void ) {
	//====================================
	// create manipulators...
	//------------------------------------
	mSaxDesktop = new SaXManipulateDesktop (
		mSection["Desktop"],mSection["Card"],mSection["Path"]
	);
	//====================================
	// select desktop
	//------------------------------------
	mSaxDesktop -> selectDesktop ( mDisplay );

	//====================================
	// import dualhead profile if set
	//------------------------------------
	QString profile = mSaxDesktop -> getDualHeadProfile();
	if ((! profile.isEmpty()) && (! mSaxDesktop->isXineramaMode())) {
		SaXImportProfile* pProfile = SaXWidgetProfile->getProfile ( profile );
		SaXImport* mImport = pProfile -> getImport ( SAX_CARD );
		if ( mImport ) {
			SaXManipulateCard saxProfileCard ( mImport );
			mProfileDriverOptions = saxProfileCard.getOptions();
		}
	}
	//====================================
	// insert CDB monitors
	//------------------------------------
	mCDBMonitorVendors = mSaxDesktop->getCDBMonitorVendorList();
	QListIterator<QString> it (mCDBMonitorVendors);
	for (; it.current(); ++it) {
		mVendorList -> insertItem (*it.current());
	}
	mVendorList -> sort();
}
开发者ID:BackupTheBerlios,项目名称:sax-svn,代码行数:37,代码来源:monitordualmodel.cpp

示例2: foreach

void KdeObservatory::updateViews()
{
    m_viewTransitionTimer->stop();

    foreach(QGraphicsWidget *widget, m_views)
        widget->hide();

    m_views.clear();
    QListIterator< QPair<QString, bool> > i (m_activeViews);
    while (i.hasNext())
    {
        const QPair<QString, bool> &pair = i.next();
        const QString &view = pair.first;
        if (pair.second && m_viewProviders.value(view))
            m_views.append(m_viewProviders[view]->views());
    }

    if (m_views.count() > 0)
    {
        if (m_views.count() != m_lastViewCount)
            m_currentView = m_views.count()-1;
        moveViewRight();
        if (m_enableAutoViewChange && m_views.count() > 1)
            m_viewTransitionTimer->start();
    }
}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:26,代码来源:kdeobservatory.cpp

示例3: i

void DialogTwaLine::setStart(QPointF start)
{
    this->start=start;
    if(line!=NULL)
    {
        delete line;
        line=NULL;
    }
    QListIterator<POI*> i (list);
    while(i.hasNext())
    {
        POI * poi=i.next();
        list.removeOne(poi);
        if(poi->isPartOfTwa())
        {
            parent->slot_delPOI_list(poi);
            delete poi;
        }
    }
    this->line=new vlmLine(parent->getProj(),parent->getScene(),Z_VALUE_ROUTE);
    line->setLinePen(pen);
    this->tabWidget->setCurrentIndex(0);
    this->doubleSpinBox->setFocus();
    this->doubleSpinBox->selectAll();
    this->move(position);
    traceIt();
}
开发者ID:nohal,项目名称:qtVlm,代码行数:27,代码来源:DialogTwaLine.cpp

示例4: it

//====================================
// setCommonButtonWidth
//------------------------------------
void SCCMonitor::setCommonButtonWidth ( void ) {
	QListIterator<SCCMonitorDisplay> it (mMonitorDisplay);
	for (; it.current(); ++it) {
		SCCMonitorDisplay* display = it.current();
		display->setCommonButtonWidth();
	}
}
开发者ID:BackupTheBerlios,项目名称:sax-svn,代码行数:10,代码来源:monitor.cpp

示例5: iter

 void JsUtil::toString(QVariant object,QString &output) {
  	if (object.type() == QVariant::Map) {
         QMapIterator<QString,QVariant> iter(object.value<QVariantMap>());
         QString sep = "";
         if (iter.hasNext()) {
             output += "{";
             do {
             	iter.next();
             	output += sep;
              	output += iter.key();
              	output += ":";
                 toString(iter.value(),output);
                 sep = ",";
             } while (iter.hasNext());
             output += "}";
         }
 	} else if (object.type() == QVariant::List) {
         QListIterator<QVariant> iter (object.value<QVariantList>());
         QString sep = "";
         if (iter.hasNext()) {
         	output += "[";
             do {
             	output += sep;
                 toString(iter.next(),output);
                 sep = ",";
             } while (iter.hasNext());
             output += "]";
         }
  	} else if (object.type() == QVariant::String) {
  		output += "\"" + object.toString() + "\"";
  	} else if (object.type() == QVariant::Bool || object.type() == QVariant::Int || object.type() == QVariant::Double || object.type() == QVariant::LongLong) {
         output += object.toString();
  	}
 }
开发者ID:Amiagin,项目名称:blackberry,代码行数:34,代码来源:JsUtil.cpp

示例6: qDebug

void UpdatingModel::setUrl(const QUrl& _url)
{
  qDebug() << "model set_url " << "old " << url << "new " << _url;

  if (_url != url) {
    url = _url;
    qDebug() << "cleared model";
    clear();

    if (settings->contains(url.toString()))
      lastModified = settings->value(url.toString()).toDateTime();

    // attempt to fill from cache
    if (url2listCache->contains(url)) {
      qDebug() << "pulling from cache " << url;

      QList<QString> *itemList = url2listCache->value(url);
      QListIterator<QString> i (*itemList);
      while (i.hasNext()) {
        appendRow(new QStandardItem(i.next()));
      }
      sort(0);

    } else {
      // fire the timer now
      timer->start(50);
    }
  }
}
开发者ID:idaohang,项目名称:mole,代码行数:29,代码来源:models.cpp

示例7: it

//====================================
// getArrangement
//------------------------------------
QDict<QString> SCCMonitorArrange::getArrangement ( void ) {
	QDict<QString> result;
	QList<SCCLayoutLine> layout = mMatrix->getLayout();
	QListIterator<SCCLayoutLine> it (layout);
	for (; it.current(); ++it) {
		QString* key   = new QString();
		QString* value = new QString();
		SCCLayoutLine* l = it.current();
		int neighbour[4] = {l->mLeft,l->mRight,l->mTop,l->mBottom};
		key->sprintf("Screen:Screen[%d]",mCardID[l->ID]);
		for (int n=0;n<4;n++) {
		if (neighbour[n] == -1) {
			value->sprintf (
				"%s <none>",value->ascii()
			);
		} else {
			value->sprintf (
				"%s Screen[%d]",value->ascii(),neighbour[n]
			);
		}
		}
		*value = value->stripWhiteSpace();
		result.insert (
			*key,value
		);
	}
	return result;
}
开发者ID:BackupTheBerlios,项目名称:sax-svn,代码行数:31,代码来源:monitorarrange.cpp

示例8: sender

void MainWindow::joystickTrayShow()
{
    QMenu *tempmenu = (QMenu*) sender();
    QList<QAction*> menuactions = tempmenu->actions();
    QListIterator<QAction*> listiter (menuactions);
    while (listiter.hasNext())
    {
        QAction *action = listiter.next();
        action->setChecked(false);

        QHash<QString, QVariant> tempmap = action->data().toHash();
        QHashIterator<QString, QVariant> iter(tempmap);
        while (iter.hasNext())
        {
            iter.next();
            int joyindex = iter.key().toInt();
            int configindex = iter.value().toInt();
            JoyTabWidget *widget = (JoyTabWidget*)ui->tabWidget->widget(joyindex);

            if (configindex == widget->getCurrentConfigIndex())
            {
                action->setChecked(true);
            }
        }
    }
}
开发者ID:tioui,项目名称:antimicro,代码行数:26,代码来源:mainwindow.cpp

示例9: reload

void ExportGesamt::reload()
{
    QListIterator<AActivity*> iter = manager->getActivities();
    int i = 0;
    while(iter.hasNext()) {
        AActivity *a = iter.next();
        if (actToList.contains(a)) {
            QString farbe = MainWindow::getFarbe(a);
            actToList.value(a)->setBackgroundColor(QColor(farbe));
            actToList.value(a)->setToolTip(a->getAnlass());
            i++;
            continue;
        }
        QString farbe = MainWindow::getFarbe(a);
        QListWidgetItem *item = new QListWidgetItem(a->getListString());
        item->setBackgroundColor(QColor(farbe));
        item->setToolTip(a->getAnlass());
        ui->listAnzeige->insertItem(i, item);
        liste.insert(i, a);
        actToList.insert(a, item);
        listToAct.insert(item, a);
        i++;
    }
    show();
}
开发者ID:philjosch,项目名称:Einsatzplaner,代码行数:25,代码来源:exportgesamt.cpp

示例10: it

void FormatterApp::fillCombos()
{

    StorageInfo storageInfo;
    const QList<FileSystem> &fs = storageInfo.fileSystems();
    QListIterator<FileSystem> it ( fs );
    QString storage;
    for( ; it.current(); ++it )
    {
        const QString name = (*it)->name();
        const QString path = (*it)->path();
        const QString disk = (*it)->disk();
        const QString options = (*it)->options();
        if( name.find( tr("Internal"),0,TRUE) == -1)
        {
            storageComboBox->insertItem(name +" -> "+disk);
        }
        //        deviceComboBox->insertItem(disk);
    }
    parsetab("/etc/mtab");
    //    parsetab("/etc/fstab");
    fileSystemsCombo->insertStringList( fsList,-1);
    deviceComboBox->insertStringList( deviceList,-1);
    storageComboSelected(0);
    deviceComboSelected(0);
}
开发者ID:opieproject,项目名称:opie,代码行数:26,代码来源:formatter.cpp

示例11: outputStringList

void outputStringList(QIODevice& output, const QStringList& sl){
    QListIterator<QString> itr (sl);
    while (itr.hasNext()) {
        output.write(QString(itr.next()).toUtf8());

    }
}
开发者ID:app211,项目名称:buildMemories,代码行数:7,代码来源:main.cpp

示例12: insertNode

void TreeItem::insertNode(GNode * node)
{
    nodeObj_ = node;
    node->setGuiPtr(this);
//      return;
    QListIterator < GNode > it = QListIterator < GNode > (node->children());
    while (it.current()) {
        GNode *n = it.current();
#ifdef DEBUGMSG
        qDebug("TreeItem: add %s\n", (const char *) n->name());
#endif
        TreeItem *item = new TreeItem(this, n->name());
        ASSERT(item!=0);
        if (n->isA("SNode")) {
            pixmap_.resize(20, 10);
            pixmap_.fill(((SNode *) n)->color());
            item->setPixmap(0, pixmap_);
        }
#if 0
        if (nodeObj_->isCompound())
            item->setPixmap(0, *pixmap_compound);
        else
            item->setPixmap(0, *pixmap_generalize);
#endif
#ifdef DEBUGMSG
        qDebug("TreeItem: done %s\n", (const char *) n->name());
#endif
        item->insertNode(n);
        ++it;
    }
    setOpen(TRUE);
}
开发者ID:BackupTheBerlios,项目名称:geoaida-svn,代码行数:32,代码来源:treeitem.cpp

示例13: save

void FavouriteManagerPrivate::save()
{
    QDomDocument document;
    QDomElement rootElement = document.createElement("favourites");

    QListIterator<QPair<QString, Station> > iterator
            = QListIterator<QPair<QString, Station> >(data);
    while (iterator.hasNext()) {
        QPair<QString, Station> entry = iterator.next();
        QDomElement element = XmlConversionHelper::toXml(entry.second, &document);
        element.setAttribute(BACKEND_ATTRIBUTE, entry.first);
        rootElement.appendChild(element);
    }
    document.appendChild(rootElement);

    QDir favouriteDir = QDir(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
    if (!favouriteDir.exists()) {
        QDir::root().mkpath(favouriteDir.absolutePath());
    }


    QFile file (favouriteDir.absoluteFilePath(fileName));
    if (!file.open(QIODevice::WriteOnly)) {
        return;
    }

    QTextStream stream(&file);
    document.save(stream, 2);
    file.close();
}
开发者ID:SfietKonstantin,项目名称:publictransportation-old,代码行数:30,代码来源:favouritemanager.cpp

示例14: model

void SubassemblyView::addDependency ( const QVector<uint>& surface_id )
{
  // Basically, the idea here is to connect to each component of the
  // references path whose name change could affect the display.  So,
  // exhustively examine each element of the path and see what it
  // means to us. Note, since part faces are not real ModelItems, we
  // skip the last element of the id_path.
  QVector<uint> id_path;
  id_path.reserve( surface_id.size()-1 );

  for ( int i = 0; i < surface_id.size()-1; ++i ) {
    id_path.push_back( surface_id[i] );
    ModelItem* item = model()->lookup( id_path );
    // The first order check is that we don't already depend on this item.
    bool found = false;
    QListIterator<std::shared_ptr<ModelItem>> it (dependencies_);
    while(it.hasNext()) {
        if(it.next().get() == item) {
            found = true;
            break;
        }
    }
    if ( found ) {
      continue;
    }
    // If it's a model, part or assembly, then it can be renamed by the user.
    else if ( dynamic_cast<Model*>( item ) != 0 ||
	      dynamic_cast<Assembly*>( item ) != 0 ||
	      dynamic_cast<Part*>( item ) != 0 ) {
      dependencies_.append( std::shared_ptr<ModelItem>(item) );
      connect( item, SIGNAL( nameChanged(const QString&) ),
	       SLOT( updateConstraintName( const QString&) ) );
    }
  }
}
开发者ID:mcirsta,项目名称:lignumCAD,代码行数:35,代码来源:subassemblyview.cpp

示例15: lit

//---------------------------------------------------------------------------
//  getWordItems
//
//! Construct a list of word items to be inserted into a word list, based on
//! the results of a list of searches.
//
//! @param searchSpecs the list of search specifications
//! @return a list of word items
//---------------------------------------------------------------------------
QList<WordTableModel::WordItem>
WordVariationDialog::getWordItems(const QList<SearchSpec>& searchSpecs) const
{
    QList<WordTableModel::WordItem> wordItems;
    QMap<QString, QString> wordMap;
    QListIterator<SearchSpec> lit (searchSpecs);
    while (lit.hasNext()) {
        QStringList wordList = wordEngine->search(lexicon, lit.next(), false);
        QStringListIterator wit (wordList);
        while (wit.hasNext()) {
            QString str = wit.next();
            wordMap.insert(str.toUpper(), str);
        }
    }

    QMapIterator<QString, QString> mit (wordMap);
    while (mit.hasNext()) {
        mit.next();
        QString value = mit.value();
        QList<QChar> wildcardChars;
        for (int i = 0; i < value.length(); ++i) {
            QChar c = value[i];
            if (c.isLower())
                wildcardChars.append(c);
        }
        QString wildcard;
        if (!wildcardChars.isEmpty()) {
            qSort(wildcardChars.begin(), wildcardChars.end(),
                  Auxil::localeAwareLessThanQChar);
            foreach (const QChar& c, wildcardChars)
                wildcard.append(c.toUpper());
        }
        wordItems.append(WordTableModel::WordItem(
            mit.key(), WordTableModel::WordNormal, wildcard));
    }
开发者ID:LyndaFinn,项目名称:zyzzyva-pc,代码行数:44,代码来源:WordVariationDialog.cpp


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