#include #include #include #include int main(int argc, char **argv) { QApplication app(argc, argv); QGraphicsScene *scene = new QGraphicsScene; scene->setBackgroundBrush(QColor(61, 61, 61)); QGraphicsSimpleTextItem *item = new QGraphicsSimpleTextItem("abcdefghijklmnopqrstuvwxyz"); /* The problem is most obvious with this font, but appears with other fonts and sizes as well. */ item->setFont(QFont("Calibri", 13, QFont::Bold)); item->setBrush(QColor(127, 127, 127)); item->setCacheMode(QGraphicsItem::DeviceCoordinateCache); item->setPos(5, 5); scene->addItem(item); QGraphicsSimpleTextItem *goodItem = new QGraphicsSimpleTextItem("abcdefghijklmnopqrstuvwxyz"); goodItem->setFont(item->font()); goodItem->setBrush(item->brush()); goodItem->setPos(5, 25); scene->addItem(goodItem); QGraphicsView *view = new QGraphicsView(scene); view->show(); return app.exec(); }