[Qt-interest] problem in QLInef()
chandrasekar wagmare
sekarwagmare at gmail.com
Thu Feb 26 14:12:25 CET 2009
hi friends ,
i need a help to clarify my doubt in QLineF() .. i dont know
where i am commiting the mistake ..
in mainwindow.cpp (QGraphicsView())
i create a line item class ....
line1 = new LineItem(QLineF(2,4, 132 ,160), Qt::blue);
line1->setPos(374,215);
and
in lineitem.cpp
LineItem::LineItem(const QLineF &line, const Qt::GlobalColor color)
: QGraphicsLineItem(line),
color(color)
void LineItem ::paint(QPainter *painter, const QStyleOptionGraphicsItem
*option, QWidget *)
{
painter->setPen(QColor(color));
QReal value = 90;
line().setAngle(value);
painter->drawLine(line());
}
here the line is drawn perfectly but i cant fix the angle ... its not
turning in counter clockwise ... not like transform.rotate .. why ?
please help ...
CHANDRU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090226/b607d4cc/attachment.html
More information about the Qt-interest-old
mailing list