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


C++ QList::removeAll方法代码示例

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


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

示例1: request

QPair<QList<QNetworkRequest>, QStringList> Cache::createRequests(const QList<QUrl> &in,
																 bool refreshAll)
{
	QList<QUrl> urlsIn = in;
	QList<QNetworkRequest> requests;
	{
		QList<QUrl> urls = refreshAll ? in : getStaleUrls(in);
		requests.reserve(urls.size());
		for (const auto url : urls) {
			urlsIn.removeAll(url);
			QNetworkRequest request(url);
			const auto entryIt = findEntry(url);
			if (entryIt != m_entries.end()) {
				const auto entry = *entryIt;
				// TODO add the md5 as a header
			}
			requests.append(request);
		}
	}
	QStringList localfiles;
	{
		// loop through all urls that didn't get made into network requests
		for (const auto url : urlsIn) {
			localfiles.append(absoluteFilename(*findEntry(url)));
		}
	}
	return qMakePair(requests, localfiles);
}
开发者ID:02JanDal,项目名称:soqute,代码行数:28,代码来源:cache.cpp

示例2: splitTrack

void GpxTreeWidget::splitTrack() {
    assert(_gpx!=0);
    assert(selectedItems().size()==1);

    QList<QTreeWidgetItem*> tracks = selectedItems();
    tracks.removeAll(root);
    if (tracks.size()==0) return;

    QString newFileName = QFileDialog::getSaveFileName(this,
                          tr("Choose a file to save to"),
                          tr("."),
                          tr("GPX Files (*.gpx)"));
    if (newFileName == tr("")) return;
    GpxTrackSegment s = _gpx->segmentByName(selectedItems()[0]->text(1));
    GpxFile *newGpx = new GpxFile(s);
    QString strValue;
    newGpx->toXml(strValue);

    QFile file( newFileName );
    if (file.open(QIODevice::WriteOnly)) {
        QTextStream out(&file);
        out << strValue;
    }
    delete newGpx;
}
开发者ID:jl2,项目名称:gpx_tools,代码行数:25,代码来源:gpxtreewidget.cpp

示例3: qDebug

QList<QVector3D> ControlPlan2D::controlLed(const QString & valeur,Cube cubeMotif,int NumeroPlan,QList<QVector3D>  liste_vecteur3D,Ui::MainWindow *ui,QPushButton* buttons[90]){
        QString strlig=valeur[0];
        QString strcol=valeur[1];
        int lig=strlig.toInt(0,10);
        int col=strcol.toInt(0,10);
        Led l;
        l=cubeMotif.getList1()->value(NumeroPlan).getLed(lig,col);
        l.modifierEtat();
        Plan p1=cubeMotif.getList1()->value(NumeroPlan);
        p1.updatePlan(l,lig,col);
        cubeMotif.updateCube(p1,NumeroPlan);
        QVector3D v;
        v=QVector3D(abs(8-col),NumeroPlan,abs(8-lig));
        liste_vecteur3D.append(v);
        QString s ;
        s=QString::number(liste_vecteur3D.size());
        qDebug()<<"la taille de la liste est "+s;
        ui->widget->setListPoints(liste_vecteur3D);
        if(cubeMotif.getList1()->value(NumeroPlan).getLed(lig,col).getEtat()==1){
            liste_vecteur3D.append(v);
           ui->widget->setListPoints(liste_vecteur3D);
        }
        else {
            liste_vecteur3D.removeAll(v);
            ui->widget->setListPoints(liste_vecteur3D);
        }
        afficheLed(buttons,lig,col,l.getEtat());
        return liste_vecteur3D;
}
开发者ID:ppff,项目名称:Cubicle-GUI,代码行数:29,代码来源:controlplan2d.cpp

示例4: canObjectBeRemoved

bool MenuNavigation::canObjectBeRemoved(QPoint location)
{
	QList<QPoint> locations = menuObjects.keys();
	QList<QPoint> checkedLocations;
	locations.removeAll(location);
	if (locations.size() == 0)
		return true;
	checkedLocations.append(locations.first());
	for (int i = 0; i < checkedLocations.size(); ++i)
	{
		QPoint loc = QPoint(checkedLocations[i]);
		QPoint loc2;
		loc2 = QPoint(loc.x(), loc.y() - 1);
		if (locations.contains(loc2) && !checkedLocations.contains(loc2))
			checkedLocations.append(loc2);
		loc2 = QPoint(loc.x() - 1, loc.y());
		if (locations.contains(loc2) && !checkedLocations.contains(loc2))
			checkedLocations.append(loc2);
		loc2 = QPoint(loc.x() + 1, loc.y());
		if (locations.contains(loc2) && !checkedLocations.contains(loc2))
			checkedLocations.append(loc2);
		loc2 = QPoint(loc.x(), loc.y() + 1);
		if (locations.contains(loc2) && !checkedLocations.contains(loc2))
			checkedLocations.append(loc2);
	}
	if (checkedLocations.size() != locations.size())
		return false;
	return true;
}
开发者ID:timdetering,项目名称:openrpgmaker,代码行数:29,代码来源:projectdata_menunavigation.cpp

示例5: QRect

/**
 * @brief Returns all items that intersect the rectangle drawn by the user
 * except selected items.
 * @return The items thet intersect the drawn rectangle.
 */
QList<QGraphicsItem*> TilesetView::get_items_intersecting_current_area() const {

  QRect area = current_area_item->rect().toRect();
  area = QRect(
      area.topLeft() + QPoint(1, 1),
      area.size() - QSize(2, 2));
  QList<QGraphicsItem*> items = scene->items(area, Qt::IntersectsItemBoundingRect);
  items.removeAll(current_area_item);  // Ignore the drawn rectangle itself.

  // Ignore selected items.
  for (QGraphicsItem* item : scene->selectedItems()) {
    items.removeAll(item);
  }

  return items;
}
开发者ID:vlag,项目名称:solarus-quest-editor,代码行数:21,代码来源:tileset_view.cpp

示例6: openEditAutoProfileDialog

void MainSettingsDialog::openEditAutoProfileDialog()
{
    int selectedRow = ui->autoProfileTableWidget->currentRow();
    if (selectedRow >= 0)
    {
        QTableWidgetItem *item = ui->autoProfileTableWidget->item(selectedRow, 5);
        //QTableWidgetItem *itemDefault = ui->autoProfileTableWidget->item(selectedRow, 4);
        AutoProfileInfo *info = item->data(Qt::UserRole).value<AutoProfileInfo*>();
        if (info != allDefaultProfile)
        {
            QList<QString> reservedGUIDs = defaultAutoProfiles.keys();
            if (info->getGUID() != "all")
            {
                AutoProfileInfo *temp = defaultAutoProfiles.value(info->getGUID());
                if (info == temp)
                {
                    reservedGUIDs.removeAll(info->getGUID());
                }
            }
            AddEditAutoProfileDialog *dialog = new AddEditAutoProfileDialog(info, settings, connectedDevices, reservedGUIDs, true, this);
            connect(dialog, SIGNAL(accepted()), this, SLOT(transferEditsToCurrentTableRow()));
            dialog->show();
        }
        else
        {
            EditAllDefaultAutoProfileDialog *dialog = new EditAllDefaultAutoProfileDialog(info, settings, this);
            dialog->show();
            connect(dialog, SIGNAL(accepted()), this, SLOT(transferEditsToCurrentTableRow()));
        }
    }
}
开发者ID:Xatory,项目名称:antimicro,代码行数:31,代码来源:mainsettingsdialog.cpp

示例7: nearestFormat

QAudioFormat QAudioDeviceInfo::nearestFormat(const QAudioFormat &settings) const
{
    if (isFormatSupported(settings))
        return settings;

    QAudioFormat nearest = settings;

    nearest.setCodec(QLatin1String("audio/pcm"));

    if (nearest.sampleType() == QAudioFormat::Unknown) {
        QAudioFormat preferred = preferredFormat();
        nearest.setSampleType(preferred.sampleType());
    }

    QMap<int,int> testFrequencies;
    QList<int> frequenciesAvailable = supportedFrequencies();
    QMap<int,int> testSampleSizes;
    QList<int> sampleSizesAvailable = supportedSampleSizes();

    // Get sorted sampleSizes (equal to and ascending values only)
    if (sampleSizesAvailable.contains(settings.sampleSize()))
        testSampleSizes.insert(0,settings.sampleSize());
    sampleSizesAvailable.removeAll(settings.sampleSize());
    foreach (int size, sampleSizesAvailable) {
        int larger  = (size > settings.sampleSize()) ? size : settings.sampleSize();
        int smaller = (size > settings.sampleSize()) ? settings.sampleSize() : size;
        if (size >= settings.sampleSize()) {
            int diff = larger - smaller;
            testSampleSizes.insert(diff, size);
        }
    }
开发者ID:BGmot,项目名称:Qt,代码行数:31,代码来源:qaudiodeviceinfo.cpp

示例8: slotDelStudentClicked

void CStudentManage::slotDelStudentClicked()
{
    //开始事务
    m_Model->database().transaction();
    //获取被选中的model
    QItemSelectionModel *selectModel = m_View->selectionModel();

    //通过被选中的model, 获取被选中的格子
    QModelIndexList selectList = selectModel->selectedIndexes();

    QList<int> delRow;

    //遍历格子,获得行
    for (int i = 0; i < selectList.size(); ++i)
    {
        delRow << selectList.at(i).row();
    }

    //去除重复的行
    while (delRow.size() > 0)
    {
        int row = delRow.at(0);
        //去重
        delRow.removeAll(row);

        //删除行
        m_Model->removeRow(row);
    }
    //提交
    QString msg = "删除成功!";
    SubmitData(msg);
}
开发者ID:stucky68,项目名称:data,代码行数:32,代码来源:CStudentManage.cpp

示例9: prepend

void tst_QList::prepend() const
{
    QList<QString *> list;
    QString *str1 = new QString;
    list.prepend(str1);
    QVERIFY(list.size() == 1);
    QVERIFY(list.at(0) == str1);
    QString *str2 = new QString;
    list.prepend(str2);
    QVERIFY(list.size() == 2);
    QVERIFY(list.at(0) == str2);
    QVERIFY(list.at(1) == str1);
    QString *str3 = new QString;
    list.prepend(str3);
    QVERIFY(list.size() == 3);
    QVERIFY(list.at(0) == str3);
    QVERIFY(list.at(1) == str2);
    QVERIFY(list.at(2) == str1);
    list.removeAll(str2);
    delete str2;
    QVERIFY(list.size() == 2);
    QVERIFY(list.at(0) == str3);
    QVERIFY(list.at(1) == str1);
    QString *str4 = new QString;
    list.prepend(str4);
    QVERIFY(list.size() == 3);
    QVERIFY(list.at(0) == str4);
    QVERIFY(list.at(1) == str3);
    QVERIFY(list.at(2) == str1);
    qDeleteAll(list);
    list.clear();
}
开发者ID:maxxant,项目名称:qt,代码行数:32,代码来源:tst_qlist.cpp

示例10:

QList<int> YaEventNotifier::unskippedIds() const
{
	QList<int> ids = GlobalEventQueue::instance()->ids();
	foreach(int id, skipped_ids_)
		ids.removeAll(id);
	return ids;
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:7,代码来源:yaeventnotifier.cpp

示例11: qDebug

ChatClient::~ChatClient()
{
    qDebug("ChatClient 0x%llx destroyed", reinterpret_cast<qint64>(this));
    chatClients.removeAll(this);
    theClientObserver()->clientDestroyed(this);
    delete d;
}
开发者ID:jlaine,项目名称:wilink,代码行数:7,代码来源:client.cpp

示例12:

QList<ViewLayer::ViewIdentifier> MismatchingConnectorWidget::views() {
	QList<ViewLayer::ViewIdentifier> list = AllViews;
	for(int i=0; i < m_missingViews.size(); i++) {
		list.removeAll(m_missingViews[i]);
	}
	return list;
}
开发者ID:bacchante95,项目名称:fritzing,代码行数:7,代码来源:mismatchingconnectorwidget.cpp

示例13:

ChatEditBox::~ChatEditBox()
{
// 	disconnect(m_chatWidgetActions->colorSelector(), 0, this, 0);
	disconnect(InputBox, 0, this, 0);

	chatEditBoxes.removeAll(this);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例14: loadSortColumns

/*!
 * This function loads sort columns from the given display descriptor. Columns
 * that are not in the descriptor's s_columns field are still added, but they
 * are initially "disabled" and in an arbitrary order.
 *
 * \param d The display descriptor to process.
 */
void CSDDSelectorModel::loadSortColumns(
	const CSAbstractCollection::DisplayDescriptor *d)
{
	items.clear();

	QList<CSAbstractCollection::Column> colsList;
	colsList.append(CSAbstractCollection::Artist);
	colsList.append(CSAbstractCollection::Album);
	colsList.append(CSAbstractCollection::Title);
	colsList.append(CSAbstractCollection::DiscNumber);
	colsList.append(CSAbstractCollection::TrackNumber);
	colsList.append(CSAbstractCollection::TrackCount);
	colsList.append(CSAbstractCollection::Length);
	colsList.append(CSAbstractCollection::Year);

	for(int i = 0; i < d->s_columns.count(); ++i)
	{
		CSAbstractCollection::Column col = d->s_columns.at(i);
		colsList.removeAll(col);

		items.append( {col, true} );
	}

	while(!colsList.isEmpty())
		items.append( {colsList.takeFirst(), false} );

	Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0));
}
开发者ID:CmdrMoozy,项目名称:cutesync,代码行数:35,代码来源:ddselectormodel.cpp

示例15:

QList<T> Utilities::listSubtract(const QList<T>& l1, const QList<T>& l2)
{
    QList<T> r = l1;
    Q_FOREACH(const T& x, l2)
        r.removeAll(x);
    return r;
}
开发者ID:Df458,项目名称:kphotoalbum-multitags-branch,代码行数:7,代码来源:List.cpp


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