本文整理汇总了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;
}
示例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;
}