Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What font for adding numbers in GraphicsScene

What font for adding numbers in GraphicsScene

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 495 Views 1 Watching
  • 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 Offline
    D Offline
    droelf
    wrote on last edited by
    #1

    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
    0
    • D Offline
      D Offline
      droelf
      wrote on last edited by
      #2

      anybody maybe help? :/

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved