本文整理汇总了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();
}
示例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();
}
}
示例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();
}
示例4: it
//====================================
// setCommonButtonWidth
//------------------------------------
void SCCMonitor::setCommonButtonWidth ( void ) {
QListIterator<SCCMonitorDisplay> it (mMonitorDisplay);
for (; it.current(); ++it) {
SCCMonitorDisplay* display = it.current();
display->setCommonButtonWidth();
}
}
示例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();
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}
}
示例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();
}
示例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);
}
示例11: outputStringList
void outputStringList(QIODevice& output, const QStringList& sl){
QListIterator<QString> itr (sl);
while (itr.hasNext()) {
output.write(QString(itr.next()).toUtf8());
}
}
示例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);
}
示例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();
}
示例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&) ) );
}
}
}
示例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));
}