Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    What font for adding numbers in GraphicsScene

    General and Desktop
    1
    2
    339
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      droelf last edited by

      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? :/

      1 Reply Last reply Reply Quote 0
      • D
        droelf last edited by

        anybody maybe help? :/

        1 Reply Last reply Reply Quote 0
        • First post
          Last post