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