QtreeWidget QtreeWidget

 

QtreeWidget  QtreeWidget

    ui->treeWidget->setColumnCount(1); //设置列数
    ui->treeWidget->setHeaderLabel(tr("构件选择")); //设置头的标题
    ui->treeWidget->setHeaderHidden(true);//隐藏表头
    QPalette p(ui->treeWidget->palette());//设置背景色
    p.setColor(QPalette::Base, QColor("#ced9e6"));
    ui->treeWidget->setPalette(p);
    QTreeWidgetItem *imageItem1 = new QTreeWidgetItem(ui->treeWidget,QStringList(QString("主构件")));
    imageItem1->setBackgroundColor(0,QColor("#e5ebf4"));//设置背景颜色
    QTreeWidgetItem *imageItem1_1 = new QTreeWidgetItem(imageItem1,QStringList(QString("钢柱"))); //子节点1
    QTreeWidgetItem *imageItem1_2 = new QTreeWidgetItem(imageItem1,QStringList(QString("钢梁"))); //子节点2
    QTreeWidgetItem *imageItem1_3 = new QTreeWidgetItem(
上一篇:[M贪心] lc1838. 最高频元素的频数(前缀和+二分+双指针+滑动窗口+周赛238_2)


下一篇:2021-3-20 238. 除自身以外数组的乘积(双重动态规划)