本文整理汇总了C++中QListIterator::next方法的典型用法代码示例。如果您正苦于以下问题:C++ QListIterator::next方法的具体用法?C++ QListIterator::next怎么用?C++ QListIterator::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListIterator
的用法示例。
在下文中一共展示了QListIterator::next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addDependency
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&) ) );
}
}
}
示例2: toString
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();
}
}
示例3: 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();
}
示例4: setUrl
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);
}
}
}
示例5: wit
//---------------------------------------------------------------------------
// 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));
}
示例6: play
bool Dispatcher::play(QStringList::Iterator it)
{
if (it == m_history.end()) {
return false;
}
bool playing = false;
QUrl url(*it);
QListIterator<MediaHandler*> mhit = m_loader->mediaHandlersIterator();
while (mhit.hasNext()) {
MediaHandler* handler = mhit.next();
if (handler->handles(url)) {
stop();
connect(handler, SIGNAL(playbackFinished()), m_timer, SLOT(stop()));
connect(handler, SIGNAL(playbackFinished()), this, SLOT(next()));
m_currentHandler = handler;
m_currentHandler->setMedia(url);
togglePlayback();
playing = true;
break;
}
}
if (playing) {
m_currentHistoryPosition = it;
} else {
m_history.erase(it);
m_currentHistoryPosition = m_history.begin();
}
return playing;
}
示例7: outputStringList
void outputStringList(QIODevice& output, const QStringList& sl){
QListIterator<QString> itr (sl);
while (itr.hasNext()) {
output.write(QString(itr.next()).toUtf8());
}
}
示例8: 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();
}
示例9: list
MyFileSystemNodeItem::MyFileSystemNodeItem (const QFileInfo & info, QObject * parent)
: QObject (parent)
, m_size (info.size ())
, m_info (info)
{
MyFileSystemNodeItem::s_instances.insert (m_info.filePath (), this);
if (m_info.isDir ()) {
const QFileInfoList list (QDir (m_info.filePath ()).entryInfoList (filter, sort));
#ifdef USE_ITERATOR
QListIterator<QFileInfo> it (list);
while (it.hasNext ()) {
m_size += (new MyFileSystemNodeItem (it.next (), this))->getSize ();
}
#else
# ifdef USE_FOREACH
foreach (QFileInfo entry, list) {
m_size += (new MyFileSystemNodeItem (entry, this))->getSize ();
}
# else
const int nb = list.count ();
for (int idx = 0; idx < nb; idx++) {
m_size += (new MyFileSystemNodeItem (list.at (idx), this))->getSize ();
}
# endif
#endif
}
}
示例10: updateViews
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();
}
}
示例11: joystickTrayShow
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);
}
}
}
}
示例12: setStart
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();
}
示例13: processFilters
void processFilters(QImage *& image, QListIterator<Filter *> i)
{
while (i.hasNext())
{
Filter * f = i.next();
uint w = image->width();
uint h = image->height();
if (f->getArea().isNull())
{
f->setArea(QRect(QPoint(0, 0), QSize(w, h)));
}
if (! f->isApplicable(w, h))
{
QRect area = f->getArea();
fatal(QObject::tr("Too small image (%1x%2), pointed filter"
" with pointed area (%3x%4+%5+%6) not applicable")
.arg(w).arg(h).arg(area.x()).arg(area.y())
.arg(area.width()).arg(area.height()));
}
QImage * newImage = f->filter(*image);
delete image;
image = newImage;
}
}
示例14: clientInit
//=========================================
// clientInit
//-----------------------------------------
void ServerHandler::clientInit (void) {
QListIterator<ServerFolder*> it (mFolderList);
while (it.hasNext()) {
ServerFolder* thisFolder = it.next();
thisFolder -> updateFolder();
}
mServer -> writeClient ("INIT_DONE");
}
示例15: while
/*public*/ SignalMast* SmlBeanTableDataModel::getDestMastFromRow(int row) const{
// if object has been deleted, it's not here; ignore it
QHash<SignalMastLogic*, SignalMast*>* b = act->signalMastLogicList->at(row);
QListIterator<SignalMastLogic*> en = b->keys();
while (en.hasNext()) {
return b->value(en.next());
}
return NULL;
}