My Qgraphicsview widget is not resized by the vertical splitter which has control.
I have a verticalsplitter with to elements. One has the Vstrech to 1 and the lower to 3.
Initially I have a standar widget promoted to a 'my_drawer' widget. This had the paint event overloaded, nothing more. All worked fine. The verticalsplitter assigned the correct heigths'
Ok, now this 'my_drawer' widget is qgraphicsview based. I have deleted the paintevent and write a drawbackground, nothing more.
Ok, I dont know why is the reason because now the vertical splitter does nothing. My qgraphicswidget has 30 pixels of height.....
Any idea ?
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
Please provide a minimal compilable example reproducing the problem.
1 Attachment(s)
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
Here you are.
The Vsplitter has 2 widgets , top widget has svtrech = 1, bottom widget has vstrecht = 3.
The bottom widget is promoted to a agraph ( a simple widget with Qgraphicsview inheritate)
As you can see when run, something is wrong. There is no 1/3 relation .
You only need to denote the widget_2 and you see the splitter working fine.
Any idea ?
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
What sense does it make to use QSplitter with relative widget sizing? If you just want initial sizes to be set, use QSplitter::setSizes(). Indeed splitters misbehave a bit when layout facilities are applied to them.
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
mmm
I dont understand what you want to tell me....
I thought that it was sufficient to set the strech values.
I only want to have 25 and 75 % for each widget....
Then, Is it a bug ?
Thanks for your time.
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
Quote:
Originally Posted by
tonnot
I only want to have 25 and 75 % for each widget....
So remove the splitter and use a normal vertical layout.
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
Excuse me.... I also want the user can change the size if he wants.
So, finally, as you said,
Quote:
Indeed splitters misbehave a bit when layout facilities are applied to them.
it can be a bug ?
Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro
So you don't want to have 25% and 75%. You want initial sizes to be that, so use QSplitter::setSizes() as advised. Yes, it's a bug if you ask me but it has been there since ever, so I guess it is either not fixable or they don't consider it a bug.