本文整理汇总了C++中CDevice::getActiveEnvironment方法的典型用法代码示例。如果您正苦于以下问题:C++ CDevice::getActiveEnvironment方法的具体用法?C++ CDevice::getActiveEnvironment怎么用?C++ CDevice::getActiveEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDevice
的用法示例。
在下文中一共展示了CDevice::getActiveEnvironment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: data
QVariant CEnvironmentDetailsModel::data(const QModelIndex & index, int role) const {
if (!m_Environment || (!index.isValid()))
return QVariant();
if ((role == Qt::DecorationRole) && (index.column() == ENVDET_MOD_STATEMENT)) {
CDevice * device = qobject_cast<CDevice *>(m_Environment->parent());
if (m_Environment == device->getActiveEnvironment()) {
if ((qint8)(m_Environment->getSelectResults()[index.internalId()]))
return QIcon(UI_ICON_SELECTED);
}
return QIcon(UI_ICON_UNSELECTED);
}
if (role != Qt::DisplayRole)
return QVariant();
switch (index.column()) {
case ENVDET_MOD_STATEMENT:
if (m_SelectConfig.filters[index.internalId()].invert)
switch (m_SelectConfig.filters[index.internalId()].selType) {
case SelectType::USER:
return tr("not by user");
case SelectType::ARP:
return tr("not by arp");
case SelectType::ESSID:
return tr("not by ssid");
case SelectType::AND_BLOCK:
return tr("at least one not");
case SelectType::OR_BLOCK:
return tr("all not");
default:
break;
}
else
switch (m_SelectConfig.filters[index.internalId()].selType) {
case SelectType::USER:
return tr("by user");
case SelectType::ARP:
return tr("by arp");
case SelectType::ESSID:
return tr("by ssid");
case SelectType::AND_BLOCK:
return tr("all");
case SelectType::OR_BLOCK:
return tr("at least one");
default:
break;
}
case ENVDET_MOD_VALUE:
switch (m_SelectConfig.filters[index.internalId()].selType) {
case SelectType::ARP:
if (m_SelectConfig.filters[index.internalId()].macAddr.valid())
return m_SelectConfig.filters[index.internalId()].ipAddr.toString() + ", "+
m_SelectConfig.filters[index.internalId()].macAddr.toString();
else
return m_SelectConfig.filters[index.internalId()].ipAddr.toString();
case SelectType::ESSID:
return m_SelectConfig.filters[index.internalId()].essid;
default:
break;
}
default:
break;
}
return QVariant();
}