当前位置: 首页>>代码示例>>C++>>正文


C++ Abi::os方法代码示例

本文整理汇总了C++中Abi::os方法的典型用法代码示例。如果您正苦于以下问题:C++ Abi::os方法的具体用法?C++ Abi::os怎么用?C++ Abi::os使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Abi的用法示例。


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

示例1: targetAbi

QList<Utils::FileName> GccToolChain::suggestedMkspecList() const
{
    Abi abi = targetAbi();
    Abi host = Abi::hostAbi();

    // Cross compile: Leave the mkspec alone!
    if (abi.architecture() != host.architecture()
            || abi.os() != host.os()
            || abi.osFlavor() != host.osFlavor()) // Note: This can fail:-(
        return QList<Utils::FileName>();

    if (abi.os() == Abi::MacOS) {
        QString v = version();
        // prefer versioned g++ on mac. This is required to enable building for older Mac OS versions
        if (v.startsWith(QLatin1String("4.0")) && m_compilerCommand.endsWith(QLatin1String("-4.0")))
            return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++40"));
        if (v.startsWith(QLatin1String("4.2")) && m_compilerCommand.endsWith(QLatin1String("-4.2")))
            return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++42"));
        return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++"));
    }

    if (abi.os() == Abi::LinuxOS) {
        if (abi.osFlavor() != Abi::GenericLinuxFlavor)
            return QList<Utils::FileName>(); // most likely not a desktop, so leave the mkspec alone.
        if (abi.wordWidth() == host.wordWidth())
            return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width
        return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
    }

    if (abi.os() == Abi::BsdOS && abi.osFlavor() == Abi::FreeBsdFlavor)
        return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("freebsd-g++"));

    return QList<Utils::FileName>();
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:34,代码来源:gcctoolchain.cpp

示例2: init

void ProfileChooser::init(bool hostAbiOnly)
{
    const Abi hostAbi = Abi::hostAbi();
    foreach (const Profile *st, ProfileManager::instance()->profiles()) {
        if (!st->isValid())
            continue;
        ToolChain *tc = ToolChainProfileInformation::toolChain(st);
        if (!tc)
            continue;
        const Abi abi = tc->targetAbi();
        if (hostAbiOnly && hostAbi.os() != abi.os())
            continue;

        const QString debuggerCommand = DebuggerProfileInformation::debuggerCommand(st).toString();
        if (debuggerCommand.isEmpty())
            continue;

        const QString completeBase = QFileInfo(debuggerCommand).completeBaseName();
        const QString name = tr("%1 (%2)").arg(st->displayName(), completeBase);
        addItem(name, qVariantFromValue(st->id()));
        QString debugger = QDir::toNativeSeparators(debuggerCommand);
        debugger.replace(QString(QLatin1Char(' ')), QLatin1String("&nbsp;"));
        QString toolTip = tr("<html><head/><body><table>"
            "<tr><td>ABI:</td><td><i>%1</i></td></tr>"
            "<tr><td>Debugger:</td><td>%2</td></tr>")
                .arg(st->displayName(), QDir::toNativeSeparators(debugger));
        setItemData(count() - 1, toolTip, Qt::ToolTipRole);
    }
    setEnabled(count() > 1);
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:30,代码来源:debuggertoolchaincombobox.cpp

示例3: setCustomAbi

void AbiWidget::setCustomAbi(const Abi &current)
{
    bool blocked = blockSignals(true);
    d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
    d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
    osChanged();
    for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
        if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
            d->m_osFlavorComboBox->setCurrentIndex(i);
            break;
        }
    }
    d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
    for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
        if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
            d->m_wordWidthComboBox->setCurrentIndex(i);
            break;
        }
    }
    if (d->isCustom())
        d->m_abi->setItemData(0, current.toString());
    blockSignals(blocked);

    emit abiChanged();
}
开发者ID:AltarBeastiful,项目名称:qt-creator,代码行数:25,代码来源:abiwidget.cpp

示例4: setCustomAbi

void AbiWidget::setCustomAbi(const Abi &current)
{
    d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
    d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
    osChanged();
    for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
        if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
            d->m_osFlavorComboBox->setCurrentIndex(i);
            break;
        }
    }
    d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
    for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
        if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
            d->m_wordWidthComboBox->setCurrentIndex(i);
            break;
        }
    }
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:19,代码来源:abiwidget.cpp

示例5: ToolChain

MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi,
                             const QString &varsBat, const QString &varsBatArg, bool autodetect) :
    ToolChain(QLatin1String(Constants::MSVC_TOOLCHAIN_ID), autodetect),
    m_varsBat(varsBat),
    m_varsBatArg(varsBatArg),
    m_lastEnvironment(Utils::Environment::systemEnvironment()),
    m_abi(abi)
{
    Q_ASSERT(!name.isEmpty());
    Q_ASSERT(!m_varsBat.isEmpty());
    Q_ASSERT(QFileInfo(m_varsBat).exists());
    Q_ASSERT(abi.os() == Abi::WindowsOS);
    Q_ASSERT(abi.binaryFormat() == Abi::PEFormat);
    Q_ASSERT(abi.osFlavor() != Abi::WindowsMSysFlavor);

    setId(QString::fromLatin1("%1:%2.%3.%4").arg(Constants::MSVC_TOOLCHAIN_ID).arg(m_varsBat)
            .arg(m_varsBatArg).arg(m_debuggerCommand));

    setDisplayName(name);
}
开发者ID:renatofilho,项目名称:QtCreator,代码行数:20,代码来源:msvctoolchain.cpp

示例6: abi

Abi QmlProjectRunConfiguration::abi() const
{
    Abi hostAbi = Abi::hostAbi();
    return Abi(hostAbi.architecture(), hostAbi.os(), hostAbi.osFlavor(),
               Abi::RuntimeQmlFormat, hostAbi.wordWidth());
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:6,代码来源:qmlprojectrunconfiguration.cpp


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