Important: Please read the Qt Code of Conduct -

QGraphicsScene Zooming problem with text

  • I have a QGrpahicsScene in my test peoject . I have added some QgrpahicsItem in it . Also I drawn a watermark text in my QGraphicsscene in drawBackground method using QPainterPath . But the problem is Initially the text are shrinked in the scene when i start to zoomIn Deeply i can able to see the text clearly .

    I want the text to be in the standard width Initially (we should see it clearly ) and also when zoomIn the text width should fixed according to the zooming size . Please can any one help on it

  • Any help will be highly appreciated . Im currently out of options

  • Lifetime Qt Champion

    the 40000 sample uses

     const qreal lod = option->levelOfDetailFromTransform(painter->worldTransform());
        // Draw text
        if (lod >= 2) {
            QFont font("Times", 10);
            painter->scale(0.1, 0.1);
            painter->drawText(170, 220, QString("Manufacturer: Chip Manufacturer"));

    to draw it really small
    So you should play around with painter->scale to make text bigger i think.
    Did u try just to alter the font size?

Log in to reply