Qt导航栏 QListWidget

1
使用Qt Designer
使用QListWidget控件
1
设置样式

QListWidget::item {
    min-height: 30px;   /*设置item高度*/
    border-style: none;  /*去掉item的borber*/
    color: rgb(255, 0, 0); /*文字颜色*/
}

QListWidget::item:selected {
    background: rgb(0, 255, 0);
}

QListWidget::item:hover {  /*鼠标悬停时的效果*/
    color: rgb(0, 0, 255);
}

去除虚线框
1
文字居中
1
预览效果
1

posted @ 2018-08-31 15:42  thomas_blog  阅读(1222)  评论(0编辑  收藏  举报