reisizeEvent changes scene item position
I have implemented QGraphicsView and some elements inside. Once I resize the main window where QGraphicsView element embedded all elements whos parent is scene will change position. I could handle no position changes on resizeEvent, but i believe there could be some better stndart solution for that.
Could anyone give some advise and simple code sample. I am quite new to QT Pyside.
Thanks in advance! :)
Hi and welcome
Do you mean you want to have QGraphicsView resize automatically to main window size??
If yes, then layouts are super for that.
I need to achieve that on resizeEvent items in scene does not change position.
But they should not move?
Did you output x,y before and after resize?
If i try the 40000 sample
They are not moving anywhere within the scene on resize.
So maybe its different in python or I dont understand what you mean?
I did no position changes before and after resize event.
Should I do that ?
I hoped there is some mode that all elements stay on the same place while resize mainWindow.
So the correct solution is manually hold scene coordinates of item on the same place while resizing ?
Well this is the part i dont understand.
Normally you dont have to do anything, it just works so im very unsure
what is happening when you resize.
Does the normal samples comes with PySide?
You could check some example and see if it also does "this moving" you dont want.
Ahh, you mean, you dont like that it redraws the elements While you are dragging mainwindow?