本文整理汇总了C++中qHash函数的典型用法代码示例。如果您正苦于以下问题:C++ qHash函数的具体用法?C++ qHash怎么用?C++ qHash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qHash函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qHash
qint64 qHash(const QFileInfo& fi)
{
return qHash(fi.absoluteFilePath());
}
示例2: kDebug
QList< GtfsRealtimeTripUpdate >* GtfsRealtimeTripUpdate::fromProtocolBuffer( const QByteArray &data )
{
kDebug() << "GTFS-realtime trip updates received" << data.size();
GtfsRealtimeTripUpdates *tripUpdates = new GtfsRealtimeTripUpdates();
transit_realtime::FeedMessage feedMessage;
if ( !feedMessage.ParsePartialFromArray(data.constData(), data.size()) ) {
kDebug() << "Wrong protocol buffer format" << data.constData();
return tripUpdates;
}
if ( feedMessage.has_header() && feedMessage.header().gtfs_realtime_version() != "1"
&& feedMessage.header().gtfs_realtime_version() != "1.0" )
{
kDebug() << "Unsupported GTFS-realtime version:"
<< feedMessage.header().gtfs_realtime_version().data();
return tripUpdates;
}
kDebug() << "entityCount:" << feedMessage.entity_size();
tripUpdates->reserve( feedMessage.entity_size() );
for ( int i = 0; i < feedMessage.entity_size(); ++i ) {
GtfsRealtimeTripUpdate tripUpdate;
const transit_realtime::TripUpdate newTripUpdate = feedMessage.entity( i ).trip_update();
const transit_realtime::TripDescriptor newTripDescriptor = newTripUpdate.trip();
tripUpdate.routeId = qHash( QString(newTripDescriptor.route_id().data()) );
tripUpdate.tripId = qHash( QString(newTripDescriptor.trip_id().data()) );
QDate startDate = QDate::fromString( newTripDescriptor.start_date().data() );
tripUpdate.startDateTime = QDateTime( startDate,
QTime::fromString(newTripDescriptor.start_time().data()) );
tripUpdate.tripScheduleRelationship = static_cast<TripScheduleRelationship>(
newTripDescriptor.schedule_relationship() );
for ( int n = 0; n < newTripUpdate.stop_time_update_size(); ++n ) {
GtfsRealtimeStopTimeUpdate stopTimeUpdate;
const transit_realtime::TripUpdate::StopTimeUpdate newStopTimeUpdate =
newTripUpdate.stop_time_update( n );
stopTimeUpdate.stopId = qHash( QString(newStopTimeUpdate.stop_id().data()) );
stopTimeUpdate.stopSequence = newStopTimeUpdate.stop_sequence();
stopTimeUpdate.arrivalDelay = newStopTimeUpdate.arrival().has_delay()
? qint32(newStopTimeUpdate.arrival().delay()) : -1;
stopTimeUpdate.arrivalTime = newStopTimeUpdate.arrival().has_time()
? QDateTime::fromTime_t(newStopTimeUpdate.arrival().time()) : QDateTime();
stopTimeUpdate.arrivalUncertainty = newStopTimeUpdate.arrival().uncertainty();
stopTimeUpdate.departureDelay = newStopTimeUpdate.departure().has_delay()
? qint32(newStopTimeUpdate.departure().delay()) : -1;
stopTimeUpdate.departureTime = newStopTimeUpdate.departure().has_time()
? QDateTime::fromTime_t(newStopTimeUpdate.departure().time()) : QDateTime();
stopTimeUpdate.departureUncertainty = newStopTimeUpdate.departure().uncertainty();
stopTimeUpdate.scheduleRelationship =
static_cast<GtfsRealtimeStopTimeUpdate::ScheduleRelationship>(
newStopTimeUpdate.schedule_relationship() );
tripUpdate.stopTimeUpdates << stopTimeUpdate;
}
tripUpdates->append( tripUpdate );
}
return tripUpdates;
}
示例3: qHash
uint qHash(const QMessageId &id)
{
return qHash(id.toString());
}
示例4: locker
void QNativeWifiEngine::scanComplete()
{
QMutexLocker locker(&mutex);
if (!available()) {
locker.unlock();
emit updateCompleted();
return;
}
// enumerate interfaces
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
#endif
locker.unlock();
emit updateCompleted();
return;
}
QStringList previous = accessPointConfigurations.keys();
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
WLAN_AVAILABLE_NETWORK_LIST *networkList;
result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
3, 0, &networkList);
if (result != ERROR_SUCCESS) {
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
__FUNCTION__, result);
#endif
continue;
}
QStringList seenNetworks;
for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) {
WLAN_AVAILABLE_NETWORK &network = networkList->Network[j];
QString networkName;
if (network.strProfileName[0] != 0) {
networkName = QString::fromWCharArray(network.strProfileName);
} else {
networkName = QByteArray(reinterpret_cast<char *>(network.dot11Ssid.ucSSID),
network.dot11Ssid.uSSIDLength);
}
const QString id = QString::number(qHash(QLatin1String("WLAN:") + networkName));
previous.removeAll(id);
QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
if (!(network.dwFlags & WLAN_AVAILABLE_NETWORK_HAS_PROFILE))
state = QNetworkConfiguration::Undefined;
if (network.strProfileName[0] != 0) {
if (network.bNetworkConnectable) {
if (network.dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
state = QNetworkConfiguration::Active;
else
state = QNetworkConfiguration::Discovered;
} else {
state = QNetworkConfiguration::Defined;
}
}
if (seenNetworks.contains(networkName))
continue;
else
seenNetworks.append(networkName);
if (accessPointConfigurations.contains(id)) {
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
bool changed = false;
ptr->mutex.lock();
if (!ptr->isValid) {
ptr->isValid = true;
changed = true;
}
if (ptr->name != networkName) {
ptr->name = networkName;
changed = true;
}
if (ptr->state != state) {
ptr->state = state;
changed = true;
}
//.........这里部分代码省略.........
示例5: qHash
uint qHash(const YAxis*& yaxis, uint seed)
{
return qHash(yaxis->id) ^ seed;
}
示例6: qHash
uint qHash(const NodeAbstractProperty &property)
{
return qHash(AbstractProperty(property));
}
示例7: qHash
QString SqlUtils::createIdentifier(const QString& text)
{
uint hash = qHash(text);
return QString::number(hash, 16);
}
示例8: qHash
uint qHash (const Dependency& dep)
{
return qHash (QString::number (dep.Type_) + dep.Name_ + dep.Version_);
}
示例9: qHash
uint qHash(const EwsId &id, uint seed)
{
return qHash(id.id(), seed) ^ qHash(id.changeKey(), seed) ^ static_cast<uint>(id.type());
}
示例10: qHash
inline uint qHash(const QSslCertificate &cert)
{
return qHash(cert.toPem());
}
示例11: qHash
uint qHash(const Team &team)
{
return qHash( team.getName() ) ^ qHash( team.getClub() );
}
示例12: qHash
uint qHash(const KeyType &key)
{
return qHash(key.foo);
}
示例13: qHash
quint32 qHash(const Ban &b) {
return qHash(b.qsHash) ^ qHash(b.haAddress) ^ qHash(b.qsUsername) ^ qHash(b.iMask);
}
示例14: qHash
/*!
\since 4.4
Computes a hash key for the QSourceLocation \a location.
\relates QSourceLocation
*/
uint qHash(const QSourceLocation &location)
{
/* Not the world's best hash function exactly. */
return qHash(location.uri().toString()) + location.line() + location.column();
}
示例15: qHash
uint qHash(const QVariant &var)
{
if (!var.isValid() || var.isNull())
return -1;
switch (var.type())
{
case QVariant::Int:
return qHash( var.toInt() );
case QVariant::UInt:
return qHash( var.toUInt() );
case QVariant::Bool:
return qHash( var.toUInt() );
case QVariant::Double:
return qHash( var.toUInt() );
case QVariant::LongLong:
return qHash( var.toLongLong() );
case QVariant::ULongLong:
return qHash( var.toULongLong() );
case QVariant::String:
return qHash( var.toString() );
case QVariant::Char:
return qHash( var.toChar() );
case QVariant::StringList:
return qHash( var.toString() );
case QVariant::ByteArray:
return qHash( var.toByteArray() );
case QVariant::Date:
case QVariant::Time:
case QVariant::DateTime:
case QVariant::Url:
case QVariant::Locale:
case QVariant::RegExp:
return qHash( var.toString() );
case QVariant::Map:
case QVariant::List:
case QVariant::BitArray:
case QVariant::Size:
case QVariant::SizeF:
case QVariant::Rect:
case QVariant::LineF:
case QVariant::Line:
case QVariant::RectF:
case QVariant::Point:
case QVariant::UserType:
case QVariant::Invalid:
default:
Q_ASSERT(false);
}
// could not generate a hash for the given variant
Q_ASSERT(false);
return 0;
}