Reputation: 84
Im making a GUI for my program and currently trying to figure out what this component would be called.
Does anyone know what this would be called or how I could achieve this effect?
Upvotes: 1
Views: 110
Reputation:
Add a QListWidget
to your ui form from the Qt Designer toolbox window. And click right on it then click changeStylesheet... then paste this:
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;
}
It looks like this:
To learn how style sheets work in relation to QListView
, see http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview
Upvotes: 4
Reputation: 2588
It is a QMenu with QActions attached to it. First you create a QAction, connect with the related slot, and attach to QMenu. Then attach the menu to a QWidget (or its subclass)
Upvotes: 0