How to get a QGlyphRun for a single character?



  • Hi,
    I want to get a QGlyphRun for a single character and the way I do is:

        QCharRef c = text[text.length()-1];
        QTextLayout *pTextLayout = new QTextLayout(QString(c));
        pTextLayout->setFont(font);
        pTextLayout->beginLayout();
        pTextLayout->createLine();
        pTextLayout->endLayout();
        QList<QGlyphRun> glyphData = pTextLayout->glyphRuns();
    

    Is there a quicker way of doing it ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.