View Full Version : line movement

14th August 2009, 09:22
Hi fellas,

Imagine you have a shape like capital h which is ' H '. And now imagine that, you need to move the horizontal line between the verticals in that H. What strategy you could follow?

Thanks in advance.

14th August 2009, 09:24
What do you mean? You want a font like that or what are you saying? You don't know how to draw such a shape? QPainter::drawLine() is for drawing lines...

14th August 2009, 10:12
What I want to mean is moving the horizontal line in 'H' between the 2 parallel lines(which are also vertical) in 'H' . H is just a metaphor obviously.

You can also think H like that; |_|. The important point is to make the horizontal line item( _ ) move ONLY between those verticals( | |).

Hope it's clear now.

14th August 2009, 10:23
Ok, but what is the problem? What is that you don't know how to do?

14th August 2009, 10:25
Well, if the line are finite, it's cool to move the horizontal line. The problem occurs when the line are kind of indefinite or something. Catch that?

14th August 2009, 11:39
Not really... Is your problem with maths or with Qt API?

17th August 2009, 07:37
Oh... with maths actually. I try to find the most efficient way.

17th August 2009, 19:01
Before moving the horizontal line compare its "start coordinate to be" Y value with the Y value of one of the vertical lines. If it would be outside the range the vertical lines define, don't move the horizontal line.