• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ qHash函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qHash函数的典型用法代码示例。如果您正苦于以下问题:C++ qHash函数的具体用法?C++ qHash怎么用?C++ qHash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: qHash

qint64 qHash(const QFileInfo& fi)
{
	return qHash(fi.absoluteFilePath());
}
开发者ID:Lukas-W,项目名称:lmms,代码行数:4,代码来源:PluginFactory.cpp


示例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;
}
开发者ID:KDE,项目名称:publictransport,代码行数:64,代码来源:gtfsrealtime.cpp


示例3: qHash

uint qHash(const QMessageId &id)
{
    return qHash(id.toString());
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:4,代码来源:qmessageid_maemo6.cpp


示例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;
                }
//.........这里部分代码省略.........
开发者ID:maxxant,项目名称:qt,代码行数:101,代码来源:qnativewifiengine.cpp


示例5: qHash

uint qHash(const YAxis*& yaxis, uint seed)
{
    return qHash(yaxis->id) ^ seed;
}
开发者ID:SoftwareDefinedBuildings,项目名称:mr-plotter-qml,代码行数:4,代码来源:axis.cpp


示例6: qHash

uint qHash(const NodeAbstractProperty &property)
{
    return qHash(AbstractProperty(property));
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:4,代码来源:nodeabstractproperty.cpp


示例7: qHash

QString SqlUtils::createIdentifier(const QString& text)
{
    uint hash = qHash(text);
    return QString::number(hash, 16);
}
开发者ID:02JanDal,项目名称:sqlate,代码行数:5,代码来源:SqlUtils.cpp


示例8: qHash

			uint qHash (const Dependency& dep)
			{
				return qHash (QString::number (dep.Type_) + dep.Name_ + dep.Version_);
			}
开发者ID:Apkawa,项目名称:leechcraft,代码行数:4,代码来源:repoinfo.cpp


示例9: qHash

uint qHash(const EwsId &id, uint seed)
{
    return qHash(id.id(), seed) ^ qHash(id.changeKey(), seed) ^ static_cast<uint>(id.type());
}
开发者ID:KrissN,项目名称:akonadi-ews,代码行数:4,代码来源:ewsid.cpp


示例10: qHash

inline uint qHash(const QSslCertificate &cert)
{
    return qHash(cert.toPem());
}
开发者ID:Mikino89,项目名称:QupZilla,代码行数:4,代码来源:networkmanager.cpp


示例11: qHash

uint qHash(const Team &team)
{
  return qHash( team.getName() ) ^ qHash( team.getClub() );
}
开发者ID:Mathsoum,项目名称:Petanque,代码行数:4,代码来源:team.cpp


示例12: qHash

uint qHash(const KeyType &key)
{
    return qHash(key.foo);
}
开发者ID:mpvader,项目名称:qt,代码行数:4,代码来源:tst_qcache.cpp


示例13: qHash

quint32 qHash(const Ban &b) {
	return qHash(b.qsHash) ^ qHash(b.haAddress) ^ qHash(b.qsUsername) ^ qHash(b.iMask);
}
开发者ID:MumbleTransifexBot,项目名称:mumble,代码行数:3,代码来源:Ban.cpp


示例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();
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:12,代码来源:qsourcelocation.cpp


示例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;
}
开发者ID:lbproductions,项目名称:psconvert,代码行数:54,代码来源:dataaccessobject.cpp


示例16: qHash

/*!
  \fn uint qHash(const QPimSource &s)
  \ingroup pim
  \relates QPimSource

  Returns a hash value for the source \a s.
*/
QTOPIAPIM_EXPORT uint qHash(const QPimSource &s)
{
    return qHash(s.context) + qHash(s.identity);
}
开发者ID:rgfernandes,项目名称:qtextended,代码行数:11,代码来源:qpimsource.cpp


示例17: qHash

uint qHash(const Vertex& vertex, uint seed = 0) {
    return qHash(vertex.originalIndex, seed);
}
开发者ID:SeijiEmery,项目名称:hifi,代码行数:3,代码来源:FBXReader_Mesh.cpp


示例18: qHash

uint qHash(std::string a,uint b)
{
    return qHash(QString(a.c_str()), b);    
}
开发者ID:mamontov-cpp,项目名称:saddy-hash-perf-comparison,代码行数:4,代码来源:main.cpp


示例19: qHash

uint qHash(const KCConditional& c)
{
    return qHash(c.value1);
}
开发者ID:KDE,项目名称:koffice,代码行数:4,代码来源:KCCondition.cpp


示例20: qHash

/*!
 \internal
 \relates QApplicationArgument

 Computes a hash key on \a argument's name and returns it.
 */
uint qHash(const QApplicationArgument &argument)
{
    return qHash(argument.name());
}
开发者ID:husninazer,项目名称:qt,代码行数:10,代码来源:qapplicationargument.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qInstallMessageHandler函数代码示例发布时间:2022-05-30
下一篇:
C++ qGreen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap