ya, other std::cout gets print. but as it seems event is not getting called I am not able to see the ItemPositionHasChanged string.
Also as I have lot of rectagle getting drawn. so to improve performance initially I am drawing filled rect without border and then after some LevelOfDetails I am drawing border.
the codei s below
// Paints the item.
{
Q_UNUSED(widget);
painter->setPen(Qt::black);
painter->setBrush(brush);
if (option->levelOfDetail > 2.)
painter->drawRects(&squareRect, 1);
else
painter->fillRect(squareRect, brush);
}
// Paints the item.
void RectItem :: paint(QPainter * painter, QStyleOptionGraphicsItem const * option, QWidget * widget)
{
Q_UNUSED(widget);
painter->setPen(Qt::black);
painter->setBrush(brush);
if (option->levelOfDetail > 2.)
painter->drawRects(&squareRect, 1);
else
painter->fillRect(squareRect, brush);
}
To copy to clipboard, switch view to plain text mode
But above code also seems not working for Release version. I am not able to see border after zoom-in operations when levelOfDetails > 2.
its very strange as same code works in Debug version.
Bookmarks