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

C++ Q_INT64_C函数代码示例

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

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



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

示例1: while

bool QMutexPrivate::wait(int timeout)
{
    struct timespec ts, *pts = 0;
    QElapsedTimer timer;
    if (timeout >= 0) {
        ts.tv_nsec = ((timeout % 1000) * 1000) * 1000;
        ts.tv_sec = (timeout / 1000);
        pts = &ts;
        timer.start();
    }
    while (contenders.fetchAndStoreAcquire(2) > 0) {
        int r = _q_futex(&contenders._q_value, FUTEX_WAIT, 2, pts, 0, 0);
        if (r != 0 && errno == ETIMEDOUT)
            return false;

        if (pts) {
            // recalculate the timeout
            qint64 xtimeout = timeout * 1000 * 1000;
            xtimeout -= timer.nsecsElapsed();
            if (xtimeout < 0) {
                // timer expired after we returned
                return false;
            }

            ts.tv_sec = xtimeout / Q_INT64_C(1000) / 1000 / 1000;
            ts.tv_nsec = xtimeout % (Q_INT64_C(1000) * 1000 * 1000);
        }
    }
    return true;
}
开发者ID:phen89,项目名称:rtqt,代码行数:30,代码来源:qmutex_unix.cpp


示例2: switch

void MWToolsOrientation::shortAction()
{
    ++m_currentstate;

    switch (m_currentstate)
    {
    case 1:
        m_value = "top";
        m_timestamp = Q_INT64_C(-1);
        setIcon(1);
        break;
    case 2:
        m_value = "left";
        m_timestamp = Q_INT64_C(-1);
        setIcon(2);
        break;
    case 3:
        m_value = "auto";
        m_timestamp = 0;
        m_currentstate=0;
        setIcon(0);
        break;
    }

    emit ValueChanged(QVariantList() << m_value, m_timestamp);
}
开发者ID:CODeRUS,项目名称:system-ui-widgets,代码行数:26,代码来源:MWToolsOrientation.cpp


示例3: Q_INT64_C

int QHexEdit::addressWidth()
{
    qint64 size = _chunks->size();
    int n = 1;
    if (size > Q_INT64_C(0x100000000)) {
        n += 8;
        size /= Q_INT64_C(0x100000000);
    }
    if (size > 0x10000) {
        n += 4;
        size /= 0x10000;
    }
    if (size > 0x100) {
        n += 2;
        size /= 0x100;
    }
    if (size > 0x10) {
        n += 1;
        size /= 0x10;
    }

    if (n > _addressWidth)
        return n;
    else
        return _addressWidth;
}
开发者ID:hellprototypes,项目名称:Hell-serial-tool,代码行数:26,代码来源:qhexedit.cpp


示例4: QObject

QGitHubReleaseAPIPrivate::QGitHubReleaseAPIPrivate(const QUrl &apiUrl, bool multi,
												   QGitHubReleaseAPI::TYPE type, QObject *p) :
	QObject(p), m_apiDownloader(new FileDownloader(apiUrl, m_userAgent)), m_jsonData(), m_vdata(),
	m_errorString(), m_rateLimit(0), m_rateLimitRemaining(0), m_singleEntryRequested(!multi),
	m_rateLimitReset(), m_avatars(), m_eTag(QString::null), m_dlOutputFile(0L),
	m_readBytes(Q_INT64_C(-1)), m_readReply(0L), m_bytesAvail(Q_INT64_C(-1)), m_type(type) {
	init();
}
开发者ID:jacmoe,项目名称:QGitHubReleaseAPI,代码行数:8,代码来源:qgithubreleaseapi_p.cpp


示例5: testCopyTo

static void testCopyTo( KArchive* archive )
{
    const KArchiveDirectory* dir = archive->directory();
    KTempDir tmpDir;
    const QString dirName = tmpDir.name();

    dir->copyTo( dirName );

    QVERIFY(QFile::exists(dirName+"dir"));
    QVERIFY(QFileInfo(dirName+"dir").isDir());

    QFileInfo fileInfo1(dirName+"dir/subdir/mediumfile2");
    QVERIFY(fileInfo1.exists());
    QVERIFY(fileInfo1.isFile());
    QCOMPARE(fileInfo1.size(), Q_INT64_C(100));

    QFileInfo fileInfo2(dirName+"hugefile");
    QVERIFY(fileInfo2.exists());
    QVERIFY(fileInfo2.isFile());
    QCOMPARE(fileInfo2.size(), Q_INT64_C(20000));

    QFileInfo fileInfo3(dirName+"mediumfile");
    QVERIFY(fileInfo3.exists());
    QVERIFY(fileInfo3.isFile());
    QCOMPARE(fileInfo3.size(), Q_INT64_C(100));

    QFileInfo fileInfo4(dirName+"my/dir/test3");
    QVERIFY(fileInfo4.exists());
    QVERIFY(fileInfo4.isFile());
    QCOMPARE(fileInfo4.size(), Q_INT64_C(29));

#ifndef Q_OS_WIN
    const QString fileName = dirName+"z/test3_symlink";
    const QFileInfo fileInfo5(fileName);
    QVERIFY(fileInfo5.exists());
    QVERIFY(fileInfo5.isFile());
    // Do not use fileInfo.readLink() for unix symlinks
    // It returns the -full- path to the target, while we want the target string "as is".
    QString symLinkTarget;
    const QByteArray encodedFileName = QFile::encodeName(fileName);
    QByteArray s;
#if defined(PATH_MAX)
    s.resize(PATH_MAX+1);
#else
    int path_max = pathconf(encodedFileName.data(), _PC_PATH_MAX);
    if (path_max <= 0) {
        path_max = 4096;
    }
    s.resize(path_max);
#endif
    int len = readlink(encodedFileName.data(), s.data(), s.size() - 1);
    if ( len >= 0 ) {
        s[len] = '\0';
        symLinkTarget = QFile::decodeName(s);
    }
    QCOMPARE(symLinkTarget, QString("test3"));
#endif
}
开发者ID:vasi,项目名称:kdelibs,代码行数:58,代码来源:karchivetest.cpp


示例6: Q_Q

void QNetworkReplyImplPrivate::_q_copyReadyRead()
{
    Q_Q(QNetworkReplyImpl);
    if (state != Working)
        return;
    if (!copyDevice || !q->isOpen())
        return;

    // FIXME Optimize to use download buffer if it is a QBuffer.
    // Needs to be done where sendCacheContents() (?) of HTTP is emitting
    // metaDataChanged ?

    forever {
        qint64 bytesToRead = nextDownstreamBlockSize();
        if (bytesToRead == 0)
            // we'll be called again, eventually
            break;

        bytesToRead = qBound<qint64>(1, bytesToRead, copyDevice->bytesAvailable());
        QByteArray byteData;
        byteData.resize(bytesToRead);
        qint64 bytesActuallyRead = copyDevice->read(byteData.data(), byteData.size());
        if (bytesActuallyRead == -1) {
            byteData.clear();
            backendNotify(NotifyCopyFinished);
            break;
        }

        byteData.resize(bytesActuallyRead);
        readBuffer.append(byteData);

        if (!copyDevice->isSequential() && copyDevice->atEnd()) {
            backendNotify(NotifyCopyFinished);
            bytesDownloaded += bytesActuallyRead;
            break;
        }

        bytesDownloaded += bytesActuallyRead;
    }

    if (bytesDownloaded == lastBytesDownloaded) {
        // we didn't read anything
        return;
    }

    lastBytesDownloaded = bytesDownloaded;
    QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
    if (preMigrationDownloaded != Q_INT64_C(-1))
        totalSize = totalSize.toLongLong() + preMigrationDownloaded;
    pauseNotificationHandling();
    // emit readyRead before downloadProgress incase this will cause events to be
    // processed and we get into a recursive call (as in QProgressDialog).
    emit q->readyRead();
    emit q->downloadProgress(bytesDownloaded,
                             totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
    resumeNotificationHandling();
}
开发者ID:Suneal,项目名称:qt,代码行数:57,代码来源:qnetworkreplyimpl.cpp


示例7: switch

qint64 BitcoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case BTC:  return Q_INT64_C(2500000000000);
    case mBTC: return Q_INT64_C(2500000000000000);
    default:   return 0;
    }
}
开发者ID:Devakkalji,项目名称:ADC,代码行数:9,代码来源:bitcoinunits.cpp


示例8: switch

qint64 CarboncoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case CARBON:  return Q_INT64_C(21000000);
    case KCARBON: return Q_INT64_C(21000);
    case MCARBON: return Q_INT64_C(21);
    default:   return 0;
    }
}
开发者ID:carboncointrust,项目名称:CarboncoinCore,代码行数:10,代码来源:carboncoinunits.cpp


示例9: switch

qint64 BitmarkUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case BTM:  return Q_INT64_C(21000000);
    case MARK: return Q_INT64_C(21000000000);
    case mb: return Q_INT64_C(21000000000000);
    default:   return 0;
    }
}
开发者ID:Amarha,项目名称:bitmark,代码行数:10,代码来源:bitmarkunits.cpp


示例10: switch

qint64 DarcoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case DAR:  return Q_INT64_C(21000000);
    case mDAR: return Q_INT64_C(21000000000);
    case uDAR: return Q_INT64_C(21000000000000);
    default:   return 0;
    }
}
开发者ID:seraph1188,项目名称:darcoin,代码行数:10,代码来源:darcoinunits.cpp


示例11: switch

qint64 BitcoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case LAT:  return Q_INT64_C(21000000);
    case mLAT: return Q_INT64_C(21000000000);
    case uLAT: return Q_INT64_C(21000000000000);
    default:   return 0;
    }
}
开发者ID:cptCort3z,项目名称:LatinumCoin,代码行数:10,代码来源:bitcoinunits.cpp


示例12: switch

qint64 VirtaCoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case VTA:  return Q_INT64_C(21000000000);
    case mVTA: return Q_INT64_C(21000000000000);
    case uVTA: return Q_INT64_C(21000000000000000);
    default:   return 0;
    }
}
开发者ID:ANGEL1507,项目名称:VirtaCoinProject,代码行数:10,代码来源:virtacoinunits.cpp


示例13: readSignedByte

qint8 readSignedByte(QIODevice &device)
{
    qint8 result = 0;
    if (device.read(reinterpret_cast<char *> (&result),
            Q_INT64_C(1)) != Q_INT64_C(1))
    {
        throw std::runtime_error("Unable to read file");
    }
    return result;
}
开发者ID:rel-eng,项目名称:QWinHelp,代码行数:10,代码来源:IOUtils.cpp


示例14: switch

qint64 NautiluscoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case NAUT:  return Q_INT64_C(21000000);
    case mNAUT: return Q_INT64_C(21000000000);
    case uNAUT: return Q_INT64_C(21000000000000);
    default:   return 0;
    }
}
开发者ID:Nosredna1970,项目名称:nautiluscoin,代码行数:10,代码来源:nautiluscoinunits.cpp


示例15: switch

qint64 iQcoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case IQC:  return Q_INT64_C(21000000);
    case mIQC: return Q_INT64_C(21000000000);
    case uIQC: return Q_INT64_C(21000000000000);
    default:   return 0;
    }
}
开发者ID:iQcoin,项目名称:iQcoin,代码行数:10,代码来源:iQcoinunits.cpp


示例16: switch

qint64 BitcoinUnits::factor(int unit)
{
    switch(unit)
    {
    case MBTCH: return Q_INT64_C(100000000000000);
    case kBTCH: return Q_INT64_C(100000000000);
    case BTCH:  return Q_INT64_C(100000000);
    case Cunt: return Q_INT64_C(1);
    default:    return Q_INT64_C(100000000);
    }
}
开发者ID:bitchincoin,项目名称:bitchcoin,代码行数:11,代码来源:bitcoinunits.cpp


示例17: switch

qint64 BitcoinUnits::maxAmount(int unit)
{
    switch(unit)
    {
    case DASH:  return Q_INT64_C(21000000);
    case mDASH: return Q_INT64_C(21000000000);
    case uDASH: return Q_INT64_C(21000000000000);
    case duffs: return Q_INT64_C(2100000000000000);
    default:   return 0;
    }
}
开发者ID:BitTokenDev,项目名称:dash,代码行数:11,代码来源:bitcoinunits.cpp


示例18: switch

qint64 BitcoinUnits::factor(int unit)
{
    switch(unit)
    {
    case MVPRC: return Q_INT64_C(100000000000000);
    case kVPRC: return Q_INT64_C(100000000000);
    case VPRC:  return Q_INT64_C(100000000);
    case Koinu: return Q_INT64_C(1);
    default:    return Q_INT64_C(100000000);
    }
}
开发者ID:vaperscoin,项目名称:vaperscoin,代码行数:11,代码来源:bitcoinunits.cpp


示例19: readSignedDWord

qint32 readSignedDWord(QIODevice &device)
{
    qint32 result = 0;
    if (device.read(reinterpret_cast<char *> (&result),
            Q_INT64_C(4)) != Q_INT64_C(4))
    {
        throw std::runtime_error("Unable to read file");
    }
    result = qFromLittleEndian(result);
    return result;
}
开发者ID:rel-eng,项目名称:QWinHelp,代码行数:11,代码来源:IOUtils.cpp


示例20: Q_INT64_C

//------------------------------------------------------------------------------
void MainWindow::rewriteFileStatus(QListWidget *listWidget, QLineEdit *labelFileStatus)
{
    int fileCount = 0;
    qint64 totalFileSize = 0;
    qint64 tera = Q_INT64_C(1099511627776);
    qint64 peta = Q_INT64_C(1125899906842624);

    for (int ii = 0; ii < listWidget->count(); ii++)
    {
        QString fpath = listWidget->item(ii)->text();
        QFile *file = new QFile(fpath);
        totalFileSize += file->size();
        fileCount++;
    }
    QString fileSizeString = "";
    if (totalFileSize == 0)
    {
        fileSizeString = "0";
    }
    else
    {
        fileSizeString = QString("%L2").arg(totalFileSize);
    }
    QString aboutFileSizeString = "";
    int aboutFileSize;
    if(totalFileSize < 1024){
        aboutFileSizeString = "";
    }
    else if(totalFileSize < 1024 * 1024){
        aboutFileSize = (int)(totalFileSize / 1024);
        aboutFileSizeString = " (" + tr("about") + QString("%1").arg(aboutFileSize) + tr("Kbyte") + ")";
    }
    else if (totalFileSize < 1073741824) // �P�M�K 1024 * 1024 * 1024
    {
        aboutFileSize = (int)(totalFileSize / (1024 * 1024));
        aboutFileSizeString = " (" + tr("about") + QString("%1").arg(aboutFileSize) + tr("Mbyte") + ")";
    }
    else if (totalFileSize < tera) // �P�e�� 1024 * 1024 * 1024 * 1024
    {
        aboutFileSize = (int)(totalFileSize / (1073741824));
        aboutFileSizeString = " (" + tr("about") + QString("%1").arg(aboutFileSize) + tr("Gbyte") + ")";
    }
    else if (totalFileSize < peta) // �P�y�^ 1024 * 1024 * 1024 * 1024 * 1024
    {
        aboutFileSize = (int)(totalFileSize / (tera));
        aboutFileSizeString = " (" + tr("about") + QString("%1").arg(aboutFileSize) + tr("Tbyte") + ")";
    }

    labelFileStatus->setText(tr("Selected File Count : ") + QString("%1").arg(fileCount) + "  " + tr("Total File Size : ") + fileSizeString + aboutFileSizeString);
}
开发者ID:hiromasah,项目名称:personal-information-mask-tool,代码行数:51,代码来源:mainwindow.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Q_IsColorString函数代码示例发布时间:2022-05-30
下一篇:
C++ Q_INIT_RESOURCE函数代码示例发布时间: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