myPainter.begin(this);
int shortSide = qMin(width(), height());
myPainter.setViewport(((width()-shortSide)/3, (height()-shortSide)/3, shortside, shortSide);
myPainter.serWindow(-50,-50,100,100);
myPainter.setPen(Qt::black);
myPainter.drawRect(-25,-25,45,60);
myPainter.end();
QPainter myPainter;
myPainter.begin(this);
int shortSide = qMin(width(), height());
myPainter.setViewport(((width()-shortSide)/3, (height()-shortSide)/3, shortside, shortSide);
myPainter.serWindow(-50,-50,100,100);
myPainter.setPen(Qt::black);
myPainter.drawRect(-25,-25,45,60);
myPainter.end();
To copy to clipboard, switch view to plain text mode
Bookmarks