Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Scrollable QGraphicsItem ?
How can I create a Scrollable GraphicsItem? I derived my class from
I did not set any widget for my class, but added some
QGraphicsItems in a
QListand set those parent as my class. viewportHint function returns, boundingRect, but no scrolling or scrollbars.
Are you going to put widgets in that scroll area ? If so, you can use the QGraphicsWidgetProxyItem
I'm going to add some
QGraphicsItems in that scroll area.
I can not find
QGraphicsWidgetProxyItemclass in documentation. I'm using Qt 5.4.1
How about nesting a
QGraphicsViewalready is scrollable.
does it have good performance?
Asperamanca last edited by
Could you describe what you are trying to achieve? Take a look at the "40000 chips" demo sample. Does this do what you need?
@Asperamanca I am going to create a listview-like horizontal list, showing 3 items at a time; which, center item is bigger than two other items. animating scaling of items on scroll.
My bad it was QGraphicsProxyWidget that I was thinking about.
That kind of things is generally easier to do with QtQuick
@SGaist I created exactly what I want in QtQuick, but I can not integrate that component in QGraphicsView. I searched a lot, but it seems that it can not be done :(
You can try with a QQuickWidget but I don't know if it would work that well. Depending on your application, you should maybe consider a full QtQuick UI.
@SGaist I tested this solution too. widget is shown, but no update. when I resize the window, it updates.
QGraphicsView::updateModedid not help.
What should the rest of your scene show ?
@SGaist Some other UIs that I created with Graphics Framwork classes, like
You can also show SVG images on a QtQuick UI