Line QML Type

QML Wrapper of QLineF More...

Import Statement: import .

Methods

Detailed Description

It is a singleton component

Method Documentation

point p1(object line)

Returns the line's start point.


point p2(object line)

Returns the line's end point.


qreal angle(object line)

Get the angle of the line


object create(object line)

Constructs a line object that is a clone of other line


object create(point p2)

Constructs a line object that represents the line between (0, 0) and p2.


object create(real x1, real y1, real x2, real y2)

Constructs a line object that represents the line between (x1, y1) and (x2, y2).


object create(point p1, point2)

Constructs a line object that represents the line between p1 and p2.


real dx(object line)

Returns the horizontal component of the line's vector.


real dy(object line)

Returns the vertical component of the line's vector.


bool equals(object line1, object line2)

Returns true if the line1 is same as line2.

A line is identical to another line if the start and end points are identical, and the internal order of the points is the same.


qreal length(object line)

Get the length of the line


void setAngle(object line, qreal angle)

Set the angle of the line


void setLength(object line, qreal length)

Change the length of the line


void translate(object line, real dx, real dy)

Translates this line the distance specified by dx and dy.


void translateToOrigin(object line)

Translates this line to origin (0,0) as start point


object unitVector(object line)

Returns the unit vector for this line, i.e a line starting at the same point as this line with a length of 1.0.