Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    QPainter same settings but different text sizes

    General and Desktop
    1
    1
    419
    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.
    • QT-static-prgm
      QT-static-prgm last edited by

      Hi,

      after i solved my big static problem i now comeing to the smaller problems.

      I have a program working with pictures. The pcitures can be of all size.

      In this function the pics become a text in the right lower edge. But for some reason it's on some pictures bigger and on others smaller. I cannot say it seams to depend on the size of the pictures.
      I wouldn't care, but with the a bigger size the text disappear in the border.

      @void ImageViewer::setImage(QLabel* ziel, QImage* bild)
      {
      QPen pen(Qt::red, 2);
      QPainter painter(bild);
      painter.setPen(pen);
      painter.drawText(bild->width()-100,bild->height()-10, "My text to display");

      ziel->setPixmap( QPixmap::fromImage(*bild) );
      ziel->adjustSize();
      ziel->setGeometry(8,30,bild->width(),bild->height());
      ziel->setWindowIcon(*mainIcon);
      ziel->show();
      }@

      i hope you can tell me how to fix :D

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