Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.3
-
None
-
Ubuntu 10.04
-
40b6c1dd9199ac5e0d6a1921b05c11e647d09dca
Description
main.cpp
#include <QtDebug> #include <QtGui> int main(int argc, char *argv[]) { QApplication a(argc, argv); QFontMetrics metrics(QFont("Arial", 11)); qDebug() << metrics.boundingRect("test"); qDebug() << metrics.boundingRect("test "); return a.exec(); }
On my machine, the output is:
QRect(-1,-14 26x18)
QRect(-1,-14 22x18)
Note that size decreases when the space is added. I could understand it being the same (the space doesn't need any painting room), but decrease? This is causing problem if this bounding rect is used for QPainter::drawText, because the smaller rectangle clips the text.