QListView vertical scroll bar not showing up.
-
Hey,
I am a Qt beginner. I need help with the QListView vertical scrollbar.The issue is that there is a QListView that has a list of items. Below that there is a hack to draw something directly into the viewport (An image is drawn). The whole list has no knowledge about it at all.
In this scenario, the vertical scrollbar (set as ScrollAsNeeded) is not showing up.
Could someone help me with what can I add so that when we shrink the app, a vertical scroll bar shows up instead of the image getting cut off. -
You draw something directly in the viewport of QListView ? Then you should also override the size() and sizeHint() functions so the ScrollArea knows the correct size.
-
-
Ok, from a quick look the sizeHint will not help. You have to adjust the size of the viewport() but I doubt it will really work.
-
Don't paint in the viewport but in a widget below
-
Yes. Painting inside a table/list (and outside a cell) is something I've never seen before.