Now i kept only one instance of Text_Display class and commented other...still i have the same problem.......and i think i have pos variable value within bounding rectangle....
code is below:
QRectF Text_Display
::boundingRect() const {
return QRectF(pos.
x(), pos.
y(),
200,
200);
}
QRectF Text_Display::boundingRect() const
{
return QRectF(pos.x(), pos.y(), 200, 200);
}
To copy to clipboard, switch view to plain text mode
{
painter->setFont(font);
painter->setPen(pen);
painter->drawText(pos.x(),pos.y(),text);
}
void Text_Display::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->setFont(font);
painter->setPen(pen);
painter->drawText(pos.x(),pos.y(),text);
}
To copy to clipboard, switch view to plain text mode
and thanks for replying........
Bookmarks