本文整理汇总了C++中qvariantmap::const_iterator::toBool方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::toBool方法的具体用法?C++ const_iterator::toBool怎么用?C++ const_iterator::toBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qvariantmap::const_iterator
的用法示例。
在下文中一共展示了const_iterator::toBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: capabilities
void ModemManager::ModemLocationInterface::propertiesChanged(const QString & interface, const QVariantMap & properties)
{
mmDebug() << interface << properties.keys();
if (interface == QString("org.freedesktop.ModemManager.Modem.Location")) {
QLatin1String capabilities("Capabilities");
QLatin1String enabled("Enabled");
QLatin1String signalsLocation("SignalsLocation");
QLatin1String location("Location");
QVariantMap::const_iterator it = properties.find(capabilities);
if ( it != properties.end()) {
emit capabilitiesChanged((ModemManager::ModemLocationInterface::Capability)it->toUInt());
}
it = properties.find(enabled);
if ( it != properties.end()) {
emit enabledChanged(it->toBool());
}
it = properties.find(signalsLocation);
if ( it != properties.end()) {
emit signalsLocationChanged(it->toBool());
}
it = properties.find(location);
if ( it != properties.end()) {
QVariant v = it.value();
LocationInformationMap map;
if (v.canConvert<LocationInformationMap>()) {
map = v.value<LocationInformationMap>();
} else {
mmDebug() << "Error converting LocationInformationMap property";
}
emit locationChanged(map);
}
}
}
示例2: propertiesChanged
void RemoteActivatable::propertiesChanged(const QVariantMap &changedProperties)
{
Q_D(RemoteActivatable);
QStringList propKeys = changedProperties.keys();
QLatin1String deviceUniKey("deviceUni"),
activatableTypeKey("activatableType"),
sharedKey("shared");
QVariantMap::const_iterator it = changedProperties.find(deviceUniKey);
if (it != changedProperties.end())
{
d->deviceUni = it->toString();
propKeys.removeOne(deviceUniKey);
}
it = changedProperties.find(activatableTypeKey);
if (it != changedProperties.end())
{
d->activatableType = (Knm::Activatable::ActivatableType)it->toUInt();
propKeys.removeOne(activatableTypeKey);
}
it = changedProperties.find(sharedKey);
if (it != changedProperties.end())
{
d->shared = it->toBool();
propKeys.removeOne(sharedKey);
}
/*if (propKeys.count()) {
qDebug() << "Unhandled properties: " << propKeys;
}*/
}
示例3: icPropertiesChanged
void RemoteInterfaceConnection::icPropertiesChanged(const QVariantMap &changedProperties)
{
Q_D(RemoteInterfaceConnection);
QStringList propKeys = changedProperties.keys();
QLatin1String connectionTypeKey("connectionType"),
uuidKey("uuid"),
nameKey("name"),
iconNameKey("iconName"),
activationStateKey("activationState"),
hasDefaultRouteKey("hasDefaultRoute");
QVariantMap::const_iterator it = changedProperties.find(connectionTypeKey);
if (it != changedProperties.end()) {
d->connectionType = (Knm::Connection::Type)it->toUInt();
propKeys.removeOne(connectionTypeKey);
}
it = changedProperties.find(uuidKey);
if (it != changedProperties.end()) {
d->uuid = it->toString();
propKeys.removeOne(uuidKey);
}
it = changedProperties.find(nameKey);
if (it != changedProperties.end()) {
d->name = it->toString();
propKeys.removeOne(nameKey);
}
it = changedProperties.find(iconNameKey);
if (it != changedProperties.end()) {
d->iconName = it->toString();
propKeys.removeOne(iconNameKey);
}
it = changedProperties.find(activationStateKey);
if (it != changedProperties.end()) {
d->oldActivationState = d->activationState;
d->activationState = (Knm::InterfaceConnection::ActivationState)it->toUInt();
emit activationStateChanged(d->oldActivationState, d->activationState);
propKeys.removeOne(activationStateKey);
}
it = changedProperties.find(hasDefaultRouteKey);
if (it != changedProperties.end()) {
d->hasDefaultRoute = it->toBool();
emit hasDefaultRouteChanged(d->hasDefaultRoute);
propKeys.removeOne(hasDefaultRouteKey);
}
/*if (propKeys.count()) {
kDebug() << "Unhandled properties: " << propKeys;
}*/
emit changed();
}