QPushButton, 在代码中设置border-image无效,在qss文件中设置生效?? 请教各位网友

qss文件=====ok

QTreeView::item QPushButton{
    height:40px;
    width:40px;
    background-color:transparent;
    border-image:url(":/image/dataview/下三角形_灰白 .png");
}




代码中=====not work----why???
connect(this, &QTreeWidget::itemExpanded, [](QTreeWidgetItem * item){
        MyTreeWidgetItem * myItem = static_cast(item);
        if (item->childCount() > 0){
            myItem->xxbsItem()->setDropArrawStyleSheet("height:40px;"  //work
                                                        "width:40px;"  //work
                                                        "background-color:rgba(100,0, 0,1);"     //work
                                                        "border-image:url(:/image/dataview/上三角形_灰白 .png);" //not work
                                                        "");
        }
    });

 

你可能感兴趣的:(QPushButton, 在代码中设置border-image无效,在qss文件中设置生效?? 请教各位网友)