c++ - 这个元素在 c++ Qt 中被称为什么?

标签 c++ qt user-interface

我正在为我的程序制作一个 GUI,目前正试图找出这个组件的名称。

Image

有谁知道这会叫什么或者我怎样才能达到这种效果?

最佳答案

从 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;
}

看起来像这样:

screenshot of the styled list

要了解样式表如何与 QListView 相关,请参阅 http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview

关于c++ - 这个元素在 c++ Qt 中被称为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38136567/

相关文章:

c++ - 您可以强制从静态库链接未引用的代码吗?

c++ - valgrind 不会显示堆栈跟踪

java - 如何更新Java swing背景图?

android - 如何让 Dialog 样式的 Activity 窗口填满屏幕?

c++ - C++修改数组长度

c++ - 如何减少 googletest 的冗长(覆盖默认监听器的两个方法)?

c++ - 如何获取 QCalendarWidget 中显示的所有日期

qt - 在 QGLWidget 上使用 QPainter 时需要执行哪些步骤才能启用抗锯齿功能?

c++ - 稍后初始化的小部件将不会显示在主窗口中

java - 从菜单转发操作到父类