Hamish
Hamish

Reputation: 84

What would this element be called in c++ Qt?

Im making a GUI for my program and currently trying to figure out what this component would be called.

Image

Does anyone know what this would be called or how I could achieve this effect?

Upvotes: 1

Views: 110

Answers (3)

user5255670
user5255670

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:

screenshot of the styled list

To learn how style sheets work in relation to QListView, see http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview

Upvotes: 4

baci
baci

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

Trevor Hickey
Trevor Hickey

Reputation: 37914

QListWidget is a listbox similar to the image you posted.

enter image description here

Upvotes: 1

Related Questions