Thanks for the replies, so here is my dilemma and the reason I am using widget1 and widget2 inside the splitter:
In fact my mainWindow layout is a splitter with a nested splitter, so First I have a Horizontal splitter that splits the screen in 2, so in the right "slot" I put another splitter which is a vertical splitter called "nestedsplitter". Nested splitter also splits the window in two(vertically) and I will display a QImage inside the top slot of the nested splitter and another image inside the bottom slot of nestedSplitter. I use splitter because I need to resize these images vertically whenever I want.
So in my code I use a function called createWidgets() that creates all my widgets along with the splitters, and a QGraphicsView Widget that has my scene and Graphics Item. After everything is created I layout all the widgets inside the splitters.
So when I make my QGraphicsView and scene I set the sceneRect to be the size of my QGView Widget and inside my GraphicsItem class, I pass the scene which the item will be added to, this to get the boundingRect() to return the sceneRect size which was set to be the size of the QGraphicsView widget and in the paint method I do
@
painter->drawImage(sceneRect, myImage);
@
With this I get the image painted inside the splitter slot that I want, but only a portion of it and not the entire top or bottom slot of my nestedSplitter mentioned above. For this is that I tried putting a widget (widget1) inside the splitter and passing that as parent to the QGraphicsView widget, and with that size I set the setSceneRect to later draw my image in the entire splitter slot. But the problem that its only painting a portion of the image is I think that the size of the parent I pass in this case widget1 in the splitter doesnt have a size until I set @nestedSplitter->addWidget@ and use the setsizes for the nestedsplitter.
Also when I move the splitter handler to resize it is very slow and the image doesn't get resized to fit the splitter that is containing it. Instead scrollbars appear.
So I would like to know where is it that I have to handle the resizing of the image so that when I change the size of the splitter, the image gets resized appropriately to always occupy the "slot" of the splitter that contains it, and also how can I properly set the scenerect so the whole image gets drawn and not only a portion of it even though when I pass only widget1 into the splitter it occupies the whole splitter slot as the view should.
I would really appreciate any guidance, I hope I was clear enough :)
Thanks.