ifc构件加载到树形控件中

 

void IfcTreeWidget::setParentCheckState(QTreeWidgetItem *item)
{
    if(!item) return;
    int selectedCount=0;
    int childCount = item->childCount();
    for (int i=0;i<childCount;i++)
    {
        QTreeWidgetItem* child= item->child(i);
        if(child->checkState(0)==Qt::Checked) 
        {
            selectedCount++;
        }
    }
 
    if(selectedCount == 0) {
        item->setCheckState(0,Qt::Unchecked);
    } else if (selectedCount == childCount) {
        item->setCheckState(0,Qt::Checked);
    } else {
        item->setCheckState(0,Qt::PartiallyChecked);
    }
}

 

id: 94 name: "项目编号" class: IfcProject
id: 7066 name: "Default" class: IfcSite
id: 104 name: "" class: IfcBuilding
id: 119 name: "F1" class: IfcBuildingStorey
id: 155 name: "1" class: IfcSpace
id: 235 name: "基本墙:砖墙240mm:366197" class: IfcWallStandardCase
id: 386 name: "基本墙:砖墙240mm:366288" class: IfcWallStandardCase
id: 943 name: "M_矩形-结构柱:400 x 600mm结构柱:368287" class: IfcColumn
id: 1059 name: "M_矩形-结构柱:400 x 600mm结构柱:368364" class: IfcColumn
id: 1136 name: "M_矩形-结构柱:400 x 600mm结构柱:368439" class: IfcColumn
id: 1211 name: "M_矩形-结构柱:400 x 600mm结构柱:368498" class: IfcColumn
id: 1282 name: "M_矩形-结构柱:400 x 600mm结构柱:368561" class: IfcColumn
id: 1357 name: "M_矩形-结构柱:400 x 600mm结构柱:368616" class: IfcColumn
id: 1432 name: "M_矩形-结构柱:400 x 600mm结构柱:368681" class: IfcColumn
id: 1507 name: "M_矩形-结构柱:400 x 600mm结构柱:368746" class: IfcColumn
id: 1582 name: "M_矩形-结构柱:400 x 600mm结构柱:368815" class: IfcColumn
id: 1635 name: "M_矩形-结构柱:400 x 600mm结构柱:368886" class: IfcColumn
id: 1687 name: "M_矩形-结构柱:400 x 600mm结构柱:368965" class: IfcColumn
id: 1761 name: "M_矩形-结构柱:400 x 600mm结构柱:369056" class: IfcColumn
id: 1836 name: "M_矩形-结构柱:400 x 600mm结构柱:369139" class: IfcColumn
id: 1911 name: "M_矩形-结构柱:400 x 600mm结构柱:369244" class: IfcColumn
id: 1986 name: "M_矩形-结构柱:400 x 600mm结构柱:369329" class: IfcColumn
id: 2039 name: "M_矩形-结构柱:400 x 600mm结构柱:369384" class: IfcColumn
id: 2113 name: "M_矩形-结构柱:400 x 600mm结构柱:369433" class: IfcColumn
id: 2188 name: "M_矩形-结构柱:400 x 600mm结构柱:369486" class: IfcColumn
id: 2263 name: "M_矩形-结构柱:400 x 600mm结构柱:369535" class: IfcColumn
id: 2338 name: "M_矩形-结构柱:400 x 600mm结构柱:369588" class: IfcColumn
id: 2405 name: "基本墙:砖墙240mm:369921" class: IfcWallStandardCase
id: 2467 name: "基本墙:砖墙240mm:370000" class: IfcWallStandardCase
id: 2839 name: "双开万能门:M1521:370054" class: IfcDoor
id: 3241 name: "双开万能门:M1521:370208" class: IfcDoor
id: 3292 name: "双开万能门:M1521:370285" class: IfcDoor
id: 3343 name: "双开万能门:M1521:370343" class: IfcDoor
id: 3393 name: "双开万能门:M1521:370409" class: IfcDoor
id: 3443 name: "双开万能门:M1521:370475" class: IfcDoor
id: 3493 name: "双开万能门:M1521:370597" class: IfcDoor
id: 3543 name: "双开万能门:M1521:370643" class: IfcDoor
id: 3593 name: "双开万能门:M1521:370661" class: IfcDoor
id: 3643 name: "双开万能门:M1521:370679" class: IfcDoor
id: 3693 name: "双开万能门:M1521:370729" class: IfcDoor
id: 3743 name: "双开万能门:M1521:370801" class: IfcDoor
id: 3793 name: "双开万能门:M1521:370925" class: IfcDoor
id: 125 name: "F2" class: IfcBuildingStorey
id: 3863 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371150" class: IfcBeam
id: 3987 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371196" class: IfcBeam
id: 4067 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371220" class: IfcBeam
id: 4147 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371257" class: IfcBeam
id: 4275 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371284" class: IfcBeam
id: 4403 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371316" class: IfcBeam
id: 4531 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371364" class: IfcBeam
id: 4659 name: "M_混凝土-矩形梁:300 x 600mm 矩形梁:371400" class: IfcBeam
id: 4737 name: "基本墙:砖墙240mm:371622" class: IfcWallStandardCase
id: 4801 name: "基本墙:砖墙240mm:371623" class: IfcWallStandardCase
id: 4871 name: "M_矩形-结构柱:400 x 600mm结构柱:371624" class: IfcColumn
id: 4949 name: "M_矩形-结构柱:400 x 600mm结构柱:371626" class: IfcColumn
id: 5024 name: "M_矩形-结构柱:400 x 600mm结构柱:371628" class: IfcColumn
id: 5100 name: "M_矩形-结构柱:400 x 600mm结构柱:371630" class: IfcColumn
id: 5176 name: "M_矩形-结构柱:400 x 600mm结构柱:371632" class: IfcColumn
id: 5251 name: "M_矩形-结构柱:400 x 600mm结构柱:371634" class: IfcColumn
id: 5326 name: "M_矩形-结构柱:400 x 600mm结构柱:371636" class: IfcColumn
id: 5401 name: "M_矩形-结构柱:400 x 600mm结构柱:371638" class: IfcColumn
id: 5476 name: "M_矩形-结构柱:400 x 600mm结构柱:371640" class: IfcColumn
id: 5529 name: "M_矩形-结构柱:400 x 600mm结构柱:371642" class: IfcColumn
id: 5581 name: "M_矩形-结构柱:400 x 600mm结构柱:371644" class: IfcColumn
id: 5655 name: "M_矩形-结构柱:400 x 600mm结构柱:371646" class: IfcColumn
id: 5730 name: "M_矩形-结构柱:400 x 600mm结构柱:371648" class: IfcColumn
id: 5805 name: "M_矩形-结构柱:400 x 600mm结构柱:371650" class: IfcColumn
id: 5880 name: "M_矩形-结构柱:400 x 600mm结构柱:371652" class: IfcColumn
id: 5933 name: "M_矩形-结构柱:400 x 600mm结构柱:371654" class: IfcColumn
id: 6007 name: "M_矩形-结构柱:400 x 600mm结构柱:371656" class: IfcColumn
id: 6082 name: "M_矩形-结构柱:400 x 600mm结构柱:371658" class: IfcColumn
id: 6157 name: "M_矩形-结构柱:400 x 600mm结构柱:371660" class: IfcColumn
id: 6232 name: "M_矩形-结构柱:400 x 600mm结构柱:371662" class: IfcColumn
id: 6299 name: "基本墙:砖墙240mm:371664" class: IfcWallStandardCase
id: 6361 name: "基本墙:砖墙240mm:371665" class: IfcWallStandardCase
id: 6412 name: "双开万能门:M1521:371666" class: IfcDoor
id: 6463 name: "双开万能门:M1521:371667" class: IfcDoor
id: 6513 name: "双开万能门:M1521:371668" class: IfcDoor
id: 6563 name: "双开万能门:M1521:371669" class: IfcDoor
id: 6613 name: "双开万能门:M1521:371670" class: IfcDoor
id: 6663 name: "双开万能门:M1521:371671" class: IfcDoor
id: 6713 name: "双开万能门:M1521:371672" class: IfcDoor
id: 6763 name: "双开万能门:M1521:371673" class: IfcDoor
id: 6813 name: "双开万能门:M1521:371674" class: IfcDoor
id: 6863 name: "双开万能门:M1521:371675" class: IfcDoor
id: 6913 name: "双开万能门:M1521:371676" class: IfcDoor
id: 6963 name: "双开万能门:M1521:371677" class: IfcDoor
id: 7013 name: "双开万能门:M1521:371678" class: IfcDoor
id: 131 name: "F3" class: IfcBuildingStorey
id: 430 name: "基本屋顶:架空隔热保温屋顶 - 混凝土:366656" class: IfcRoof
id: 470 name: "基本屋顶:架空隔热保温屋顶 - 混凝土:366656" class: IfcSlab
id: 504 name: "基本屋顶:架空隔热保温屋顶 - 混凝土:366656" class: IfcSlab
id: 538 name: "基本屋顶:架空隔热保温屋顶 - 混凝土:366656" class: IfcSlab
id: 572 name: "基本屋顶:架空隔热保温屋顶 - 混凝土:366656" class: IfcSlab

posted @ 2019-07-28 13:22  西北逍遥  阅读(485)  评论(0编辑  收藏  举报