Actually the example I gave was just a theoretical example.
What I have in my program is this:
//step1: calculate x and y (both numbers are OK for window size)
//step2:
resize(x,y);
//step3: do graphics and return to step 1
//step1: calculate x and y (both numbers are OK for window size)
//step2:
resize(x,y);
QApplication::processEvents();
//step3: do graphics and return to step 1
To copy to clipboard, switch view to plain text mode
steps 1 and 2 are in the same function, step 3 is in a different function.
Why does this code resize the screen only the first time it passes through it? Only the first set of x and y are executed and all the following ones are ignored.
I am doing all this to make the window wrap around a photo as I open it on the screen. Different photos are different size and I want the window size readjusted for each photo.
I use a lot of addStretch() to make my layout. Could this be causing the problem? Maybe once a large window is made the resize function cannot shrink the window because it cannot fit the expanded stretch in the new window? I don't know if this is making sense.
Bookmarks