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


C++ QSet::constEnd方法代码示例

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


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

示例1: supportedImageHandlerMimeTypes

QList<QByteArray> QImageReader::supportedMimeTypes()
{
    QSet<QByteArray> mimeTypes;
    for (int i = 0; i < _qt_NumFormats; ++i)
        mimeTypes << _qt_BuiltInFormats[i].mimeType;

#ifndef QT_NO_IMAGEFORMATPLUGIN
    supportedImageHandlerMimeTypes(loader(), QImageIOPlugin::CanRead, &mimeTypes);
#endif // QT_NO_IMAGEFORMATPLUGIN

    QList<QByteArray> sortedMimeTypes;
    for (QSet<QByteArray>::ConstIterator it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it)
        sortedMimeTypes << *it;

    qSort(sortedMimeTypes);
    return sortedMimeTypes;
}
开发者ID:cedrus,项目名称:qt,代码行数:17,代码来源:qimagereader.cpp

示例2: supportedImageHandlerFormats

QList<QByteArray> QImageReader::supportedImageFormats()
{
    QSet<QByteArray> formats;
    for (int i = 0; i < _qt_NumFormats; ++i)
        formats << _qt_BuiltInFormats[i].extension;

#ifndef QT_NO_IMAGEFORMATPLUGIN
    supportedImageHandlerFormats(loader(), QImageIOPlugin::CanRead, &formats);
#endif // QT_NO_IMAGEFORMATPLUGIN

    QList<QByteArray> sortedFormats;
    for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
        sortedFormats << *it;

    qSort(sortedFormats);
    return sortedFormats;
}
开发者ID:cedrus,项目名称:qt,代码行数:17,代码来源:qimagereader.cpp

示例3: setFormat

/*!
    Returns the list of image formats supported by QImageWriter.

    By default, Qt can write the following formats:

    \table
    \header \o Format \o Description
    \row    \o BMP    \o Windows Bitmap
    \row    \o JPG    \o Joint Photographic Experts Group
    \row    \o JPEG   \o Joint Photographic Experts Group
    \row    \o PNG    \o Portable Network Graphics
    \row    \o PPM    \o Portable Pixmap
    \row    \o TIFF   \o Tagged Image File Format
    \row    \o XBM    \o X11 Bitmap
    \row    \o XPM    \o X11 Pixmap
    \endtable

    Reading and writing SVG files is supported through Qt's
    \l{QtSvg Module}{SVG Module}.

    Note that the QApplication instance must be created before this function is
    called.

    \sa setFormat(), QImageReader::supportedImageFormats(), QImageIOPlugin
*/
QList<QByteArray> QImageWriter::supportedImageFormats()
{
    QSet<QByteArray> formats;
    formats << "bmp";
#ifndef QT_NO_IMAGEFORMAT_PPM
    formats << "ppm";
#endif
#ifndef QT_NO_IMAGEFORMAT_XBM
    formats << "xbm";
#endif
#ifndef QT_NO_IMAGEFORMAT_XPM
    formats << "xpm";
#endif
#ifndef QT_NO_IMAGEFORMAT_PNG
    formats << "png";
#endif
#ifndef QT_NO_IMAGEFORMAT_JPEG
    formats << "jpg" << "jpeg";
#endif
#ifndef QT_NO_IMAGEFORMAT_MNG
    formats << "mng";
#endif
#ifndef QT_NO_IMAGEFORMAT_TIFF
    formats << "tif" << "tiff";
#endif
#ifdef QT_BUILTIN_GIF_READER
    formats << "gif";
#endif

#ifndef QT_NO_LIBRARY
    QFactoryLoader *l = loader();
    QStringList keys = l->keys();
    for (int i = 0; i < keys.count(); ++i) {
        QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
        if (plugin && (plugin->capabilities(0, keys.at(i).toLatin1()) & QImageIOPlugin::CanWrite) != 0)
            formats << keys.at(i).toLatin1();
    }
#endif // QT_NO_LIBRARY

    QList<QByteArray> sortedFormats;
    for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
        sortedFormats << *it;

    qSort(sortedFormats);
    return sortedFormats;
}
开发者ID:Afreeca,项目名称:qt,代码行数:71,代码来源:qimagewriter.cpp

示例4: sourceLayer

void QgsComposerAttributeTableV2::setDisplayAttributes( const QSet<int>& attr, bool refresh )
{
  QgsVectorLayer* source = sourceLayer();
  if ( !source )
  {
    return;
  }

  //rebuild columns list, taking only attributes with index in supplied QSet
  qDeleteAll( mColumns );
  mColumns.clear();

  const QgsFields& fields = source->fields();

  if ( !attr.empty() )
  {
    QSet<int>::const_iterator attIt = attr.constBegin();
    for ( ; attIt != attr.constEnd(); ++attIt )
    {
      int attrIdx = ( *attIt );
      if ( !fields.exists( attrIdx ) )
      {
        continue;
      }
      QString currentAlias = source->attributeDisplayName( attrIdx );
      QgsComposerTableColumn* col = new QgsComposerTableColumn;
      col->setAttribute( fields.at( attrIdx ).name() );
      col->setHeading( currentAlias );
      mColumns.append( col );
    }
  }
  else
  {
    //resetting, so add all attributes to columns
    int idx = 0;
    Q_FOREACH ( const QgsField& field, fields )
    {
      QString currentAlias = source->attributeDisplayName( idx );
      QgsComposerTableColumn* col = new QgsComposerTableColumn;
      col->setAttribute( field.name() );
      col->setHeading( currentAlias );
      mColumns.append( col );
      idx++;
    }
  }
开发者ID:V17nika,项目名称:QGIS,代码行数:45,代码来源:qgscomposerattributetablev2.cpp

示例5: interfaceListing

static QList<QNetworkInterfacePrivate *> interfaceListing()
{
    QList<QNetworkInterfacePrivate *> interfaces;

    int socket;
    if ((socket = qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1)
        return interfaces;      // error

    QSet<QByteArray> names = interfaceNames(socket);
    QSet<QByteArray>::ConstIterator it = names.constBegin();
    for ( ; it != names.constEnd(); ++it) {
        ifreq req;
        memset(&req, 0, sizeof(ifreq));
        memcpy(req.ifr_name, *it, qMin<int>(it->length() + 1, sizeof(req.ifr_name) - 1));

        QNetworkInterfacePrivate *iface = findInterface(socket, interfaces, req);

        // Get the interface broadcast address
        QNetworkAddressEntry entry;
        if (iface->flags & QNetworkInterface::CanBroadcast) {
            if (qt_safe_ioctl(socket, SIOCGIFBRDADDR, &req) >= 0) {
                sockaddr *sa = &req.ifr_addr;
                if (sa->sa_family == AF_INET)
                    entry.setBroadcast(addressFromSockaddr(sa));
            }
        }

        // Get the interface netmask
        if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) {
            sockaddr *sa = &req.ifr_addr;
	    entry.setNetmask(addressFromSockaddr(sa));
        }

        // Get the address of the interface
        if (qt_safe_ioctl(socket, SIOCGIFADDR, &req) >= 0) {
            sockaddr *sa = &req.ifr_addr;
            entry.setIp(addressFromSockaddr(sa));
        }

        iface->addressEntries << entry;
    }

    ::close(socket);
    return interfaces;
}
开发者ID:KDE,项目名称:android-qt,代码行数:45,代码来源:qnetworkinterface_unix.cpp

示例6: cancelTileRequests

void QGeoTileFetcher::cancelTileRequests(const QSet<QGeoTileSpec> &tiles)
{
    Q_D(QGeoTileFetcher);

    typedef QSet<QGeoTileSpec>::const_iterator tile_iter;
    tile_iter tile = tiles.constBegin();
    tile_iter end = tiles.constEnd();
    for (; tile != end; ++tile) {
        QGeoTiledMapReply *reply = d->invmap_.value(*tile, 0);
        if (reply) {
            d->invmap_.remove(*tile);
            reply->abort();
            if (reply->isFinished())
                reply->deleteLater();
        }
        d->queue_.removeAll(*tile);
    }
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:18,代码来源:qgeotilefetcher.cpp

示例7: csf

CommandTransform::CommandTransform(const QSet<int> &selection, ldraw::model *model, Editor::RotationPivot pivot)
	: CommandBase(selection, model)
{
	setText(i18n("Transform"));

	pivot_ = pivot;

	bool center = false;
	if (pivot_ == Editor::PivotCenter)
		center = true;

	CommandSelectionFilter csf(this);
	pivotpoint_ = PivotExtension::queryPivot(model_, center, &csf);

	for (QSet<int>::ConstIterator it = selection.constBegin(); it != selection.constEnd(); ++it) {
		if (model->elements()[*it]->get_type() == ldraw::type_ref)
			oldmatrices_[*it] = CAST_AS_CONST_REF(model->elements()[*it])->get_matrix();
	}
}
开发者ID:rhabacker,项目名称:Konstruktor,代码行数:19,代码来源:commandtransform.cpp

示例8: initialize

void QgsComposerManager::initialize()
{
  QSettings settings;
  QSet<QgsComposer*> composers = QgisApp::instance()->printComposers();
  QSet<QgsComposer*>::const_iterator it = composers.constBegin();
  for ( ; it != composers.constEnd(); ++it )
  {
    QListWidgetItem* item = new QListWidgetItem(( *it )->title(), mComposerListWidget );
    item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
    mItemComposerMap.insert( item, *it );
  }
  mComposerListWidget->sortItems();

  mTemplate->addItem( tr( "Empty composer" ) );
  mTemplate->addItem( tr( "Specific" ) );

  mUserTemplatesDir = QgsApplication::qgisSettingsDirPath() + "/composer_templates";
  QMap<QString, QString> userTemplateMap = defaultTemplates( true );
  if ( userTemplateMap.size() > 0 )
  {
    mTemplate->insertSeparator( mTemplate->count() );
    QMap<QString, QString>::const_iterator templateIt = userTemplateMap.constBegin();
    for ( ; templateIt != userTemplateMap.constEnd(); ++templateIt )
    {
      mTemplate->addItem( templateIt.key(), templateIt.value() );
    }
  }

  mDefaultTemplatesDir = QgsApplication::pkgDataPath() + "/composer_templates";
  QMap<QString, QString> defaultTemplateMap = defaultTemplates( false );
  if ( defaultTemplateMap.size() > 0 )
  {
    mTemplate->insertSeparator( mTemplate->count() );
    QMap<QString, QString>::const_iterator templateIt = defaultTemplateMap.constBegin();
    for ( ; templateIt != defaultTemplateMap.constEnd(); ++templateIt )
    {
      mTemplate->addItem( templateIt.key(), templateIt.value() );
    }
  }

  mTemplatePathLineEdit->setText( settings.value( "/UI/ComposerManager/templatePath", QString( "" ) ).toString() );
}
开发者ID:jacklibj,项目名称:readqgis,代码行数:42,代码来源:qgscomposermanager.cpp

示例9: releaseGlyphs

void QSGSharedDistanceFieldGlyphCache::releaseGlyphs(const QSet<glyph_t> &glyphs)
{
#if defined(QSGSHAREDDISTANCEFIELDGLYPHCACHE_DEBUG)
    qDebug("QSGSharedDistanceFieldGlyphCache::releaseGlyphs() called for %s (%d glyphs)",
           m_cacheId.constData(), glyphs.size());
#endif

    m_requestedGlyphs.subtract(glyphs);

    QVector<quint32> glyphsVector;
    glyphsVector.reserve(glyphs.size());

    QSet<glyph_t>::const_iterator glyphsIt;
    for (glyphsIt = glyphs.constBegin(); glyphsIt != glyphs.constEnd(); ++glyphsIt) {
        QHash<glyph_t, void *>::iterator bufferIt = m_bufferForGlyph.find(*glyphsIt);
        if (bufferIt != m_bufferForGlyph.end()) {
            void *buffer = bufferIt.value();
            removeGlyph(*glyphsIt);
            m_bufferForGlyph.erase(bufferIt);
            Q_ASSERT(!m_bufferForGlyph.contains(*glyphsIt));

            if (!m_sharedGraphicsCache->dereferenceBuffer(buffer)) {
#if !defined(QT_NO_DEBUG)
                bufferIt = m_bufferForGlyph.begin();
                while (bufferIt != m_bufferForGlyph.end()) {
                    Q_ASSERT(bufferIt.value() != buffer);
                    ++bufferIt;
                }
#endif
            }
        }

        glyphsVector.append(*glyphsIt);
    }

    m_hasPostedEvents = true;
    QSGMainThreadInvoker *mainThreadInvoker = QSGMainThreadInvoker::instance();
    QCoreApplication::postEvent(mainThreadInvoker, new QSGReleaseItemsEvent(m_sharedGraphicsCache,
                                                                            m_cacheId,
                                                                            glyphsVector,
                                                                            m_isInSceneGraphUpdate));
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:42,代码来源:qsgshareddistancefieldglyphcache.cpp

示例10: CommandBase

CommandTransform::CommandTransform(const ldraw::matrix &premult,
                                   const ldraw::matrix &postmult,
                                   const QSet<int> &selection,
                                   ldraw::model *model,
                                   Editor::RotationPivot pivotMode,
                                   const ldraw::vector &pivot)
    : CommandBase(selection, model)
{
    setText(QObject::tr("Transform"));

    premult_ = premult;
    postmult_ = postmult;
    pivotMode_ = pivotMode;
    pivot_ = pivot;

    for (QSet<int>::ConstIterator it = selection.constBegin(); it != selection.constEnd(); ++it) {
        if (model->elements()[*it]->get_type() == ldraw::type_ref)
            oldmatrices_[*it] = CAST_AS_CONST_REF(model->elements()[*it])->get_matrix();
    }
}
开发者ID:kartoffelviking,项目名称:Konstruktor,代码行数:20,代码来源:commandtransform.cpp

示例11:

QList<QgsComposerInterface *> QgisAppInterface::openComposers()
{
  QList<QgsComposerInterface *> composerInterfaceList;
  if ( qgis )
  {
    const QSet<QgsComposer *> composerList = qgis->printComposers();
    QSet<QgsComposer *>::const_iterator it = composerList.constBegin();
    for ( ; it != composerList.constEnd(); ++it )
    {
      if ( *it )
      {
        QgsComposerInterface *v = ( *it )->iface();
        if ( v )
        {
          composerInterfaceList << v;
        }
      }
    }
  }
  return composerInterfaceList;
}
开发者ID:exlimit,项目名称:QGIS,代码行数:21,代码来源:qgisappinterface.cpp

示例12:

QList<QgsComposerView*> QgisAppInterface::activeComposers()
{
  QList<QgsComposerView*> composerViewList;
  if ( qgis )
  {
    const QSet<QgsComposer*> composerList = qgis->printComposers();
    QSet<QgsComposer*>::const_iterator it = composerList.constBegin();
    for ( ; it != composerList.constEnd(); ++it )
    {
      if ( *it )
      {
        QgsComposerView* v = ( *it )->view();
        if ( v )
        {
          composerViewList.push_back( v );
        }
      }
    }
  }
  return composerViewList;
}
开发者ID:Hardysong,项目名称:Quantum-GIS,代码行数:21,代码来源:qgisappinterface.cpp

示例13:

QList<QgsLayoutDesignerInterface *> QgisAppInterface::openLayoutDesigners()
{
  QList<QgsLayoutDesignerInterface *> designerInterfaceList;
  if ( qgis )
  {
    const QSet<QgsLayoutDesignerDialog *> designerList = qgis->layoutDesigners();
    QSet<QgsLayoutDesignerDialog *>::const_iterator it = designerList.constBegin();
    for ( ; it != designerList.constEnd(); ++it )
    {
      if ( *it )
      {
        QgsLayoutDesignerInterface *v = ( *it )->iface();
        if ( v )
        {
          designerInterfaceList << v;
        }
      }
    }
  }
  return designerInterfaceList;
}
开发者ID:tcoupin,项目名称:QGIS,代码行数:21,代码来源:qgisappinterface.cpp

示例14: resolveCollisions

void PhysicsSimulation::resolveCollisions() {
    PerformanceTimer perfTimer("resolve");
    // walk all collisions, accumulate movement on shapes, and build a list of affected shapes
    QSet<Shape*> shapes;
    int numCollisions = _collisions.size();
    for (int i = 0; i < numCollisions; ++i) {
        CollisionInfo* collision = _collisions.getCollision(i);
        collision->apply();
        // there is always a shapeA
        shapes.insert(collision->getShapeA());
        // but need to check for valid shapeB
        if (collision->_shapeB) {
            shapes.insert(collision->getShapeB());
        }
    }
    // walk all affected shapes and apply accumulated movement
    QSet<Shape*>::const_iterator shapeItr = shapes.constBegin();
    while (shapeItr != shapes.constEnd()) {
        (*shapeItr)->applyAccumulatedDelta();
        ++shapeItr;
    }
}
开发者ID:noirsoft,项目名称:hifi,代码行数:22,代码来源:PhysicsSimulation.cpp

示例15: initialize

void QgsComposerManager::initialize()
{
  QSet<QgsComposer*> composers = QgisApp::instance()->printComposers();
  QSet<QgsComposer*>::const_iterator it = composers.constBegin();
  for ( ; it != composers.constEnd(); ++it )
  {
    QListWidgetItem* item = new QListWidgetItem(( *it )->title(), mComposerListWidget );
    item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
    mItemComposerMap.insert( item, *it );
  }

  mTemplate->addItem( tr( "Empty composer" ) );

  QMap<QString, QString> templateMap = defaultTemplates();
  if ( templateMap.size() > 0 )
  {
    QMap<QString, QString>::const_iterator templateIt = templateMap.constBegin();
    for ( ; templateIt != templateMap.constEnd(); ++templateIt )
    {
      mTemplate->addItem( templateIt.key(), templateIt.value() );
    }
  }
}
开发者ID:Nald,项目名称:Quantum-GIS,代码行数:23,代码来源:qgscomposermanager.cpp


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