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. QPainter same settings but different text sizes
Forum Updated to NodeBB v4.3 + New Features

QPainter same settings but different text sizes

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 489 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.
  • QT-static-prgmQ Offline
    QT-static-prgmQ Offline
    QT-static-prgm
    wrote on last edited by
    #1

    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
    0

    • Login

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