• 4860阅读
  • 1回复

[提问]Qtpropertybrowser 中选中操作 [复制链接]

上一主题 下一主题
离线cxs05741018
 

只看楼主 倒序阅读 楼主  发表于: 2014-04-15
代码如下:
     variantManagerAction = new QtVariantPropertyManager();    topPropertyAction = variantManagerAction->addProperty(QtVariantPropertyManager::groupTypeId(), tr("动作属性"));    item = variantManagerModule->addProperty(QVariant::String, tr("名称"));    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QtVariantPropertyManager::enumTypeId(), tr("主动作类型"));    actionList << "信号动作" <<"变量动作"<<"信号和变量组合动作"<<"定时动作"<<"始终动作"<<"刀具寿命动作";    item->setAttribute(QLatin1String("enumNames"), actionList);    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QVariant::String, tr("信号名"));    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QtVariantPropertyManager::enumTypeId(), tr("条件操作符"));    //QStringList enumOpt;    operList<<">"<<"<"<<"="<<"<>";    item->setAttribute(QLatin1String("enumNames"), operList);    item->setValue(2);    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QVariant::String, tr("信号值"));    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QtVariantPropertyManager::enumTypeId(), tr("附加条件操作符"));    //QStringList addMove;    exterList<< "" <<"与"<<"或"<<"非";    item->setAttribute(QLatin1String("enumNames"), exterList);    item->setValue(0);    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QVariant::Int, tr("动作执行次数"));    item->setValue(0);    topPropertyAction->addSubProperty(item);    item = variantManagerAction->addProperty(QtVariantPropertyManager::enumTypeId(), tr("更新方式"));    QStringList updateName;    updateName<<"绝对动作"<<"相对动作";    item->setAttribute(QLatin1String("enumNames"), updateName);    item->setValue(1);    topPropertyAction->addSubProperty(item);   QtVariantEditorFactory *variantFactoryAction = new QtVariantEditorFactory();     ui.propertyAction->setFactoryForManager(variantManagerAction, variantFactoryAction);    ui.propertyAction->addProperty(topPropertyAction); 出来编辑菜单后 我可以用鼠标去选中 结果那一项变蓝  但不知道用程序代码如何去选中了
离线cxs05741018

只看该作者 1楼 发表于: 2014-04-15

如图 我要用程序选中莫一列 如何操作
快速回复
限100 字节
 
上一个 下一个