What font for adding numbers in GraphicsScene



  • I need to add int numbers in a field, but they are all blurry.
    I used this:

    QPen blackPen(Qt::black);
    QPen redPen(Qt::red);
    QBrush redBrush(Qt::red);
    blackPen.setWidth(2);
    if(cost!=0){
        myFont.setBold(false);
        myFont.setPixelSize(14);
        myFont.setFamily("Times");
        mainW->scene->addLine(f->getPos().x(),f->getPos().y(),t->getPos().x(),t->getPos().y(),blackPen);
        QString s = QString::number(cost);
        qreal x;
        qreal y;
        x = (0.5*(f->getPos().x() + t->getPos().x()))-5;
        y = (0.5*(f->getPos().y() + t->getPos().y()))-8;
        path.addText(x,y,myFont,s);
        mainW->scene->addPath(path,redPen,redBrush);
    

    Any ideas? :/



  • anybody maybe help? :/


Log in to reply
 

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