#include #include #include #include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); QPrinter myPrinter(QPrinter::HighResolution); QFont myFont(QFont("Arial",12),&myPrinter); QFontMetrics myMetrics(myFont,&myPrinter); std::cout << "Line spacing: " << myMetrics.lineSpacing() << std::endl; QString myString("Test"); std::cout << "String width: " << myMetrics.size(0,myString).width() << std::endl; return app.exec(); }