# Qwidget, centering and scaling set of lines

• Hi everybody, i am trying to create an object able to draw a set of lines.. The main problem is that lines may be very small ( e.g. QLineF(5.209959,3.572545,5.339645,3.531778)), then i want to scale them so that even if they are short they fill the image. I've tried with setWindow() and setViewPort() but i only obtained blank images.. So, assuming to have 4 variables containing the maximum and minimum X and Y calculated on all the lines, which is the magical method that solve my problem?

Thank in advance,
pamelona_69

• Sounds like you need to look into using QGraphicsView instead of QWidget.

• thanks.. i hoped for a not so destructive solution but ok, let's try this way..

[quote author="Andre" date="1323542595"]Sounds like you need to look into using QGraphicsView instead of QWidget. [/quote]