本文整理汇总了C++中TVar::getValueType方法的典型用法代码示例。如果您正苦于以下问题:C++ TVar::getValueType方法的具体用法?C++ TVar::getValueType怎么用?C++ TVar::getValueType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVar
的用法示例。
在下文中一共展示了TVar::getValueType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shouldSave
bool VarUnit::shouldSave(QTreeWidgetItem* p)
{
TVar* var = getWVar(p);
if (var->getValueType() == 6 || var->isReference()) {
return false;
}
return true;
}
示例2: buildVarTree
void VarUnit::buildVarTree(QTreeWidgetItem* p, TVar* var, bool showHidden)
{
QList<QTreeWidgetItem*> cList;
QListIterator<TVar*> it(var->getChildren(true));
while (it.hasNext()) {
TVar* child = it.next();
if (showHidden || !isHidden(child)) {
QStringList s1;
s1 << child->getName();
auto pItem = new QTreeWidgetItem(s1);
pItem->setText(0, child->getName());
pItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsTristate | Qt::ItemIsUserCheckable);
pItem->setToolTip(0, "Checked variables will be saved and loaded with your profile.");
pItem->setCheckState(0, Qt::Unchecked);
if (isSaved(child)) {
pItem->setCheckState(0, Qt::Checked);
}
if (!shouldSave(child)) { // 6 is lua_tfunction, parent must be saveable as well if not global
pItem->setFlags(pItem->flags() & ~(Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable));
pItem->setForeground(0, QBrush(QColor("grey")));
pItem->setToolTip(0, "");
}
pItem->setData(0, Qt::UserRole, child->getValueType());
QIcon icon;
switch (child->getValueType()) {
case 5:
icon.addPixmap(QPixmap(QStringLiteral(":/icons/table.png")), QIcon::Normal, QIcon::Off);
break;
case 6:
icon.addPixmap(QPixmap(QStringLiteral(":/icons/function.png")), QIcon::Normal, QIcon::Off);
break;
default:
icon.addPixmap(QPixmap(QStringLiteral(":/icons/variable.png")), QIcon::Normal, QIcon::Off);
break;
}
pItem->setIcon(0, icon);
wVars.insert(pItem, child);
cList.append(pItem);
if (child->getValueType() == 5) {
buildVarTree((QTreeWidgetItem*)pItem, child, showHidden);
}
}
}
p->addChildren(cList);
}