QGraphicsView is embedded into the QGraphicsView,QGraphicsItem incomplete
-
wrote on 26 Oct 2018, 03:39 last edited by
I have a QGraphicsView embedded into the QGraphicsView view via the QGraphicsProxyWidget, and the QGraphicsItem displayed on the embedded QGraphicsView is incomplete. Is there any way to display the scene content of embedded QGraphicsView properly?
-
Hi
By incomplete - you mean not all of the inner QGraphicsView is visible ?
Or that the QGraphicsView is smaller than it should be ?
Im wondering if you need to use
http://doc.qt.io/qt-5/qgraphicsview.html#fitInView -
Hi
Super with pictures.
So its not drawn at all it seems.
and you are sure its located as shown on second image ?
I mean, it has that size etc?the purple rect is a normal QGraphicsRectItem ?
Im not 100% sure that QGraphicsProxyWidget can handle a QGraphicsView due the event
and coordinates propagation/handling.
On the other hand, it is a Widget so no apparent reason why not.ps. btw, welcome to the forums :)
-
Hi
Super with pictures.
So its not drawn at all it seems.
and you are sure its located as shown on second image ?
I mean, it has that size etc?the purple rect is a normal QGraphicsRectItem ?
Im not 100% sure that QGraphicsProxyWidget can handle a QGraphicsView due the event
and coordinates propagation/handling.
On the other hand, it is a Widget so no apparent reason why not.ps. btw, welcome to the forums :)
wrote on 27 Oct 2018, 08:02 last edited by@mrjj
Hi
Thanks for your helpI am sure its were created and size are correct.
yes, the purple rect is a normal QGraphicsRectItem.I find QGraphicsProxyWidget pos is (0,0) ,
All item and widget under QGraphicsView can be displayed.
But I still don't know why.
maybe the transform of QGraphicsProxyWidget causes the render area of the item to be incorrect.ps. I am very happy to join the forums.
-
@mrjj
Hi
Thanks for your helpI am sure its were created and size are correct.
yes, the purple rect is a normal QGraphicsRectItem.I find QGraphicsProxyWidget pos is (0,0) ,
All item and widget under QGraphicsView can be displayed.
But I still don't know why.
maybe the transform of QGraphicsProxyWidget causes the render area of the item to be incorrect.ps. I am very happy to join the forums.
@wangcj
I also suspect the coordinates mapping might be incorrect for the nested QGraphicsView .
In theory it should work but seems not from your actual code.
The docs
http://doc.qt.io/qt-5/graphicsview.html
says
" You can even embed a new QGraphicsView into your scene to provide complex nested scenes."so it sounds like it should work. :)
What Qt version are you using ?
-
@wangcj
I also suspect the coordinates mapping might be incorrect for the nested QGraphicsView .
In theory it should work but seems not from your actual code.
The docs
http://doc.qt.io/qt-5/graphicsview.html
says
" You can even embed a new QGraphicsView into your scene to provide complex nested scenes."so it sounds like it should work. :)
What Qt version are you using ?
-
Would it be possible to test if it works in Qt5.11?
else i think you found a bug.
4/9