Re: QGraphicsScene update?
As far as I know embedding a graphics view inside graphics view doesn't work well. I don't know whether Qt4.5 introduced improvements in the matter but previous versions had problems with such configuration. Moving() a widget item won't change its boundingRect() or shape() though and that's ok. Can we see the code you are using?
Re: QGraphicsScene update?
Code:
{
Q_OBJECT
...
private:
...
}
...
//interfaceScene is a QGraphicsScene
QGraphicsProxyWidget *m_bord = interfaceScene->addWidget( new Bord());
m_bord->moveBy(40, 100);
so the QGraphicsView is added into a QGraphicsScene, resulting in a QGraphicsProxyWidget.
Here is a screenshot of the interfaceScene BEFORE moving: http://home.scarlet.be/gertnelissen/...foreMoving.jpg
Here is a screenshot AFTER: http://home.scarlet.be/gertnelissen/...fterMoving.jpg
information: the white rectangle is the size of a Bord (QGraphicsScene), there are some blocks in it (it's a puzzle), these blocks are, as you can see, not drawed well after moving
Re: QGraphicsScene update?
Hi,
you can try setPos() to move your item.
Re: QGraphicsScene update?
Sorry it has no effect, what is pretty obvious becouse moveBy is built on setPos I guess ;)
Re: QGraphicsScene update?
Hi,
I'am ok with that but sometimes it could be helpful to try different methods. If you didn't try, have it your way:)
by the way, did you add your item to the scene right? I see addWidget there maybe you should replace it with addItem?
Re: QGraphicsScene update?
been there done that :(
I've tried all manners to update a scene, and all manners to add a widget into a scene...
Maybe it's not meant to add a QGraphicsView in another?
(I've tried other QGraphicsProxyWidget and then it works just fine, the problem seems to occur only when I try to add another QGraphicsView)
Re: QGraphicsScene update?
Re: QGraphicsScene update?
Sorry if you misunderstood me, but I still haven't find any solution,
I really need to add a QGraphicsView into another QGraphicsView, I still get the error...
Re: QGraphicsScene update?
Ok,
I think you know one scene can be observed by several views but your style seems really wierd (adding another QGraphicsView inside the QGraphicsScene which inside another QGraphicsView).
Hımm, you may try to add a new scene in to your QGraphicsProxyWidget.
You can also send me your source code if possible. I can check it out.
Re: QGraphicsScene update?
The reason why I'm adding a view to another scene is because my bord (means puzzle) is a class on its own, accidentally using a scene+view itself.
My interface is a large scene/view, and graphicsitems and buttons are added to that scene. Just like that, I'm adding a Bord (puzzle) class, which is a GraphicsView itself.
Since the puzzle uses drag and drop, I can't see any other way to implement it.
Re: QGraphicsScene update?
Quote:
Originally Posted by
Gurdt
The reason why I'm adding a view to another scene is because my bord (means puzzle) is a class on its own, accidentally using a scene+view itself.
You should be able to rewrite it easily so that the internal scene is replaced by a graphics item with all the functionality retained and the scene items become child items of the "board" item.