zl程序教程

您现在的位置是:首页 >  其它

当前栏目

QTreeView样式[通俗易懂]

通俗易懂 样式 QTreeView
2023-06-13 09:11:55 时间

大家好,又见面了,我是你们的朋友全栈君。

1、无样式

2、设置被选中节点的字体颜色和背景颜色

QTreeView::item:selected{ 
   
color:#E7ECF0;
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373);
}

3、设置悬浮节点的字体颜色和背景颜色

QTreeView::item:hover{ 
   
color:#ffffff;
background:#ff0000;
}

4、设置节点的上下左右的内边距为5,外边距为0

QTreeView::item{ 
   
padding:5px;
margin:0px;
}

4、设置QTreeView的背景颜色

QTreeView{ 
   
background:#288aeb;
}

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/139869.html原文链接:https://javaforall.cn