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


C++ HostComboBox::setEnabled方法代码示例

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


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

示例1: if

static HostComboBox *LocalServerIP6()
{
    HostComboBox *gc = new HostComboBox("BackendServerIP6");
    gc->setLabel(QObject::tr("IPv6 address"));
    QList<QHostAddress> list = ServerPool::DefaultListenIPv6();
    QList<QHostAddress>::iterator it;
    for (it = list.begin(); it != list.end(); ++it)
    {
        gc->addSelection((*it).toString(), (*it).toString());
    }

#if defined(QT_NO_IPV6)
    gc->setEnabled(false);
    gc->setValue("");
#else
    if (list.isEmpty())
    {
        gc->setEnabled(false);
        gc->setValue("");
    }
    else if (list.contains(QHostAddress("::1")))
        gc->setValue("::1");
#endif
        
    gc->setHelpText(QObject::tr("Enter the IPv6 address of this machine. "
                    "Use an externally accessible address (ie, not "
                    "::1) if you are going to be running a frontend "
                    "on a different machine than this one."));
    return gc;
}
开发者ID:matt-schrader,项目名称:mythtv,代码行数:30,代码来源:backendsettings.cpp

示例2: HostComboBox

static HostComboBox *LocalServerIP6()
{
    HostComboBox *gc = new HostComboBox("BackendServerIP6");
    gc->setLabel(QObject::tr("IPv6 address"));
    QList<QHostAddress> list = QNetworkInterface::allAddresses();
    QList<QHostAddress>::iterator it;
    for (it = list.begin(); it != list.end(); ++it)
    {
        if ((*it).protocol() == QAbstractSocket::IPv6Protocol)
            gc->addSelection((*it).toString(), (*it).toString());
    }

#if defined(QT_NO_IPV6)
    gc->setEnabled(false);
    gc->setValue("");
#else
    if (list.isEmpty())
    {
        gc->setEnabled(false);
        gc->setValue("");
    }
    else
    {
        // Allow ability to have no value set, this disable IPv6
        gc->addSelection("");
        if (list.contains(QHostAddress("::1")))
            gc->setValue("::1");
    }
#endif

    gc->setHelpText(QObject::tr("Enter the IPv6 address of this machine. "
                    "Use an externally accessible address (ie, not "
                    "::1) if you are going to be running a frontend "
                    "on a different machine than this one."));
    return gc;
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:36,代码来源:backendsettings.cpp


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