节点对象获取
- 补充:
- 树形列表中的控件对象获取 ```cpp //获取顶层节点,这里只有一个根节点所以用 0 QTreeWidgetItem item = ui->tw_dl_parList->topLevelItem(0); QTreeWidgetItem child;
//分别获取根节点 0 的三个子节点 child = item->child(0); //获取子节点上的控件基类 QWidget qw_dl_codeEffi = ui->tw_dl_parList->itemWidget(child,1); //转换成对应的控件类型然后使用其方法 dynamic_cast<QLineEdit >(qw_dl_codeEffi)->setText(datalinkParList[5]);
child = item->child(1); QWidget qw_dl_dataslots = ui->tw_dl_parList->itemWidget(child,1); dynamic_cast<QLineEdit >(qw_dl_dataslots)->setText(datalinkParList[6]);
child = item->child(2); QWidget qw_dl_otherslots = ui->tw_dl_parList->itemWidget(child,1); dynamic_cast<QLineEdit >(qw_dl_otherslots)->setText(datalinkParList[7]); ```