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


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

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


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

示例1: metacall

int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv)
{
    Q_Q(QDBusInterface);

    if (c == QMetaObject::InvokeMetaMethod) {
        int offset = metaObject->methodOffset();
        QMetaMethod mm = metaObject->method(id + offset);

        if (mm.methodType() == QMetaMethod::Signal) {
            // signal relay from D-Bus world to Qt world
            QMetaObject::activate(q, metaObject, id, argv);

        } else if (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method) {
            // method call relay from Qt world to D-Bus world
            // get D-Bus equivalent signature
            QString methodName = QString::fromLatin1(mm.name());
            const int *inputTypes = metaObject->inputTypesForMethod(id);
            int inputTypesCount = *inputTypes;

            // we will assume that the input arguments were passed correctly
            QVariantList args;
            args.reserve(inputTypesCount);
            int i = 1;
            for ( ; i <= inputTypesCount; ++i)
                args << QVariant(inputTypes[i], argv[i]);

            // make the call
            QDBusMessage reply = q->callWithArgumentList(QDBus::Block, methodName, args);

            if (reply.type() == QDBusMessage::ReplyMessage) {
                // attempt to demarshall the return values
                args = reply.arguments();
                QVariantList::ConstIterator it = args.constBegin();
                const int *outputTypes = metaObject->outputTypesForMethod(id);
                int outputTypesCount = *outputTypes++;

                if (mm.returnType() != QMetaType::UnknownType && mm.returnType() != QMetaType::Void) {
                    // this method has a return type
                    if (argv[0] && it != args.constEnd())
                        copyArgument(argv[0], *outputTypes++, *it);

                    // skip this argument even if we didn't copy it
                    --outputTypesCount;
                    ++it;
                }

                for (int j = 0; j < outputTypesCount && it != args.constEnd(); ++i, ++j, ++it) {
                    copyArgument(argv[i], outputTypes[j], *it);
                }
            }

            // done
            lastError = QDBusError(reply);
            return -1;
        }
    }
    return id;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:58,代码来源:qdbusinterface.cpp

示例2: fromVariantList

/*!
    Converts the variant list \a list to a QJsonArray.

    The QVariant values in \a list will be converted to JSON values.

    \sa toVariantList(), QJsonValue::fromVariant()
 */
QJsonArray QJsonArray::fromVariantList(const QVariantList &list)
{
    QJsonArray array;
    for (QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it)
        array.append(QJsonValue::fromVariant(*it));
    return array;
}
开发者ID:AdJion,项目名称:ShaderGen,代码行数:14,代码来源:qjsonarray.cpp

示例3: toString

Grantlee::SafeString Grantlee::toString( const QVariantList &list )
{
  QString output( QLatin1Char( '[' ) );
  QVariantList::const_iterator it = list.constBegin();
  const QVariantList::const_iterator end = list.constEnd();
  while ( it != end ) {
    const QVariant item = *it;
    if ( isSafeString( item ) ) {
      output += QLatin1Literal( "u\'" )
              + static_cast<QString>( getSafeString( item ).get() )
              + QLatin1Char( '\'' );
    }
    if ( ( item.type() == QVariant::Int )
      || ( item.type() == QVariant::UInt )
      || ( item.type() == QVariant::Double )
      || ( item.userType() == QMetaType::Float )
      || ( item.type() == QVariant::LongLong )
      || ( item.type() == QVariant::ULongLong )
    ) {
      output += item.toString();
    }
    if ( item.type() == QVariant::List ) {
      output += static_cast<QString>( toString( item.toList() ).get() );
    }
    if ( ( it + 1 ) != end )
      output += QLatin1String( ", " );
    ++it;
  }

  return output.append( QLatin1Char( ']' ) );
}
开发者ID:hicknhack-software,项目名称:Qt-Grantlee,代码行数:31,代码来源:util.cpp

示例4: toString

Grantlee::SafeString Grantlee::toString( const QVariantList &list )
{
  QString output( QLatin1Char( '[' ) );
  QVariantList::const_iterator it = list.constBegin();
  const QVariantList::const_iterator end = list.constEnd();
  while ( it != end ) {
    const QVariant item = *it;
    if ( isSafeString( item ) ) {
      output += QStringLiteral( "u\'" )
              + static_cast<QString>( getSafeString( item ).get() )
              + QLatin1Char( '\'' );
    }
    if ( ( item.userType() == qMetaTypeId<int>() )
      || ( item.userType() == qMetaTypeId<uint>() )
      || ( item.userType() == qMetaTypeId<double>() )
      || ( item.userType() == qMetaTypeId<float>() )
      || ( item.userType() == qMetaTypeId<long long>() )
      || ( item.userType() == qMetaTypeId<unsigned long long>() )
    ) {
      output += item.value<QString>();
    }
    if ( item.userType() == qMetaTypeId<QVariantList>() ) {
      output += static_cast<QString>( toString( item.value<QVariantList>() ).get() );
    }
    if ( ( it + 1 ) != end )
      output += QStringLiteral( ", " );
    ++it;
  }

  return output.append( QLatin1Char( ']' ) );
}
开发者ID:heirecka,项目名称:grantlee,代码行数:31,代码来源:util.cpp

示例5: setUids

void
RuleConditionNFC::setUidsQml(const QVariantList &uids) {
    QSet<QByteArray> uidsSet;
    for (QVariantList::const_iterator i = uids.constBegin(); i != uids.constEnd(); ++i) {
        uidsSet << QByteArray::fromHex(i->toByteArray());
    }
    setUids(uidsSet);
}
开发者ID:ajalkane,项目名称:profilematic,代码行数:8,代码来源:ruleconditionnfc.cpp

示例6: requestCreateBufferViews

void CoreBufferViewManager::requestCreateBufferViews(const QVariantList &properties)
{
    QVariantList::const_iterator iter = properties.constBegin();
    QVariantList::const_iterator iterEnd = properties.constEnd();
    while (iter != iterEnd) {
        requestCreateBufferView((*iter).toMap());
        ++iter;
    }
}
开发者ID:Nekka-Lucifer,项目名称:quassel,代码行数:9,代码来源:corebufferviewmanager.cpp

示例7: initSetBufferViewIds

void BufferViewManager::initSetBufferViewIds(const QVariantList bufferViewIds)
{
    QVariantList::const_iterator iter = bufferViewIds.constBegin();
    QVariantList::const_iterator iterEnd = bufferViewIds.constEnd();
    while (iter != iterEnd) {
        newBufferViewConfig((*iter).value<int>());
        iter++;
    }
}
开发者ID:biffhero,项目名称:quassel-web,代码行数:9,代码来源:bufferviewmanager.cpp

示例8: getDaysSummaryText

QString
QmlRulesModel::getDaysSummaryText(const QVariantList &dayIndices) const {
    QSet<int> daysSet;
    QVariantList::const_iterator i = dayIndices.constBegin();
    for (; i != dayIndices.constEnd(); ++i) {
        QVariant variant = *i;
        daysSet << variant.toInt();
    }
    return getDaysSummaryText(daysSet);
}
开发者ID:fmayet,项目名称:profilematic,代码行数:10,代码来源:qmlrulesmodel.cpp

示例9: encodeArray

void QPpsObjectPrivate::encodeArray(pps_encoder_t *encoder, const QVariantList &data, bool *ok)
{
    for (QVariantList::const_iterator it = data.constBegin(); it != data.constEnd(); ++it) {
        encodeData(encoder, 0, *it, ok);
        if (!(*ok))
            return;
    }
    // if the passed data is empty, nothing went wrong and ok is set to true
    *ok = true;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:10,代码来源:qppsobject.cpp

示例10: debugDumpJson

QString debugDumpJson(QVariantList json, QString name, QString indent) {
  QString ret = "[";

  QVariantList::const_iterator it = json.constBegin();
  for (; it != json.constEnd(); ++it) 
    ret += debugDumpJson(*it, "", indent);

  ret += "\n" + indent + "]";
  if (!name.isEmpty())
    ret += " // end of " + name;
  return ret;
}
开发者ID:alphakamp,项目名称:pumpa,代码行数:12,代码来源:json.cpp

示例11: debugVariantList

static void debugVariantList(QDebug dbg, const QVariantList &list)
{
    bool first = true;
    QVariantList::ConstIterator it = list.constBegin();
    QVariantList::ConstIterator end = list.constEnd();
    for ( ; it != end; ++it) {
        if (!first)
            dbg.nospace() << ", ";
        dbg.nospace() << qPrintable(QDBusUtil::argumentToString(*it));
        first = false;
    }
}
开发者ID:Afreeca,项目名称:qt,代码行数:12,代码来源:qdbusmessage.cpp

示例12: hasValidField

static bool hasValidField(const QVariantList& list)
{
    for (QVariantList::const_iterator it = list.constBegin();
            it != list.constEnd(); ++it)
    {
        if (!(*it).isNull())
        {
            return true;
        }
    }

    return false;
}
开发者ID:rosedu,项目名称:digikam,代码行数:13,代码来源:imagescanner.cpp

示例13: receiveChannelList

void ClientIrcListHelper::receiveChannelList(const NetworkId &netId, const QStringList &channelFilters, const QVariantList &channels) {
  QVariantList::const_iterator iter = channels.constBegin();
  QVariantList::const_iterator iterEnd = channels.constEnd();

  QList<ChannelDescription> channelList;
  while(iter != iterEnd) {
    QVariantList channelVar = iter->toList();
    ChannelDescription channelDescription(channelVar[0].toString(), channelVar[1].toUInt(), channelVar[2].toString());
    channelList << channelDescription;
    iter++;
  }

  emit channelListReceived(netId, channelFilters, channelList);
}
开发者ID:Yofel,项目名称:quassel-log-export,代码行数:14,代码来源:clientirclisthelper.cpp

示例14: value

QVariant QgsListWidgetWrapper::value() const
{
  QVariant::Type type = field().type();
  if ( !mWidget ) return QVariant( type );
  if ( type == QVariant::StringList )
  {
    QStringList result;
    const QVariantList list = mWidget->list();
    for ( QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
      result.append( it->toString() );
    return result;
  }
  else
    return QVariant( mWidget->list() );
}
开发者ID:exlimit,项目名称:QGIS,代码行数:15,代码来源:qgslistwidgetwrapper.cpp

示例15:

void ChannelsJob::Private::parseChannels(const QVariantMap &result)
{
    QVariantList channelsLst = result[QLatin1String("channels")].toList();
    QVariantList::const_iterator itr;
    for (itr = channelsLst.constBegin(); itr != channelsLst.constEnd(); ++itr) {
        ChannelInfo info;
        QVariantMap channel = itr->toMap();
        info.id = channel[QLatin1String("id")].toString();
        info.name = channel[QLatin1String("name")].toString();
        info.description = channel[QLatin1String("description")].toString();
        info.images = q->session()->urlsForImage(
                          channel[QLatin1String("image")].toString());
        info.assetCount = channel[QLatin1String("assetcount")].toInt();
        channels.append(info);
    }
}
开发者ID:KDE,项目名称:bodega-client,代码行数:16,代码来源:channelsjob.cpp


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