Thanks for your help. Now the rectangle is in the middle, but when i resize the
window the rectangle also gets deformed, but i want to keep the ratio between
the width() and height() always the same and centered. If i use the set window
my drawing is deformed and if i use:
int side = qMin(width(), height());
painter.translate(width() / 2, height() / 2);
painter.scale(side / 200.0, side / 200.0);
int side = qMin(width(), height());
painter.translate(width() / 2, height() / 2);
painter.scale(side / 200.0, side / 200.0);
To copy to clipboard, switch view to plain text mode
in my code, the drawing dissapear and without setWindow the ratio is correct but
the drawing is always in lower right corner.
Bookmarks