Qt - C++ - QListView - Custom Shape
Unsolved
General and Desktop
-
I'm trying to create a QListView with a polygon shape. Or in other words, I would like that my list will look something like this:
which at this moment looks like this:
WHAT I KNOW or TRYED ALREADY:
- I know about the
paintEvent(QPaintEvent *e)
function where I can change the shape of a widget, but I don't know how can I change the shape of the actual box which contains the items of that list. - I've also tried already with
QStyledItemDelegate
and I've overridden the 2 functionspaint
andsizeHint
. But with those, I can only change the elements within the list, not the actual list shape.
In other words, the first option with
paintEvent
it's going to change my shape of the widget(the BLACK part from the image), not the container which holds the elements. The second option it's going to change just looks of elements from the list, not the container which holds them.In short, is there any way in which I can change the shape of that container?
- I know about the
-
Hi,
One thing worth trying is the Qt Graphics View Framework. You might be able to apply the transforms you want on the item but I can't guarantee it.