Logo Search packages:      
Sourcecode: qt4-x11 version File versions

src.gui.text.qfontmetrics.cpp

//! [0]
    QFont font("times", 24);
    QFontMetrics fm(font);
    int pixelsWide = fm.width("What's the width of this text?");
    int pixelsHigh = fm.height();
//! [0]


//! [1]
    QFont font("times", 24);
    QFontMetricsF fm(font);
    qreal pixelsWide = fm.width("What's the width of this text?");
    qreal pixelsHigh = fm.height();
//! [1]



Generated by  Doxygen 1.6.0   Back to index