Unsolved Scrollable QGraphicsItem ?
-
Hi.
How can I create a Scrollable GraphicsItem? I derived my class fromQScrollArea
andQGraphicsItem
.
I did not set any widget for my class, but added someQGraphicsItem
s in aQList
and set those parent as my class. viewportHint function returns, boundingRect, but no scrolling or scrollbars.Thanks.
-
Hi,
Are you going to put widgets in that scroll area ? If so, you can use the QGraphicsWidgetProxyItem
-
I'm going to add some
QGraphicsItem
s in that scroll area.
I can not findQGraphicsWidgetProxyItem
class in documentation. I'm using Qt 5.4.1How about nesting a
QGraphicsView
inside myQGraphicsScene
? becuaseQGraphicsView
already is scrollable.
does it have good performance? -
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.
changingQGraphicsView::updateMode
did not help. -
What should the rest of your scene show ?
-
@SGaist Some other UIs that I created with Graphics Framwork classes, like
QGraphicsSvgItem
-
You can also show SVG images on a QtQuick UI