本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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++;
}
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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() );
}
示例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));
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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() );
}
}
}