我正在为我的程序制作一个 GUI,目前正试图找出这个组件的名称。
有谁知道这会叫什么或者我怎样才能达到这种效果?
最佳答案
从 Qt Designer 工具箱窗口将 QListWidget
添加到您的 ui 窗体。然后右键单击它,然后单击 changeStylesheet... 然后粘贴:
QListWidget {
color:white;
border:1px solid transparent;
border-radius:10px;
padding:0px;
background:#F6911B;
show-decoration-selected: 1;
}
QListWidget::item{
border-top:1px solid #E98919;
padding: 15px;
}
QListWidget::item:hover {
border-top:1px solid #E98919;
background-color: #F6911B;
color:white;
}
QListWidget::item:selected:!active {
border-top:1px solid #E98919;
background-color:white;
color:#F6911B;
}
看起来像这样:
要了解样式表如何与 QListView
相关,请参阅 http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview
关于c++ - 这个元素在 c++ Qt 中被称为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38136567/