Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPainterPath to QPixmapItem
Qt 6.12 LTS is out! See what's new in the release blog

QPainterPath to QPixmapItem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.7k Views 2 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.
  • S Offline
    S Offline
    samdol
    wrote on last edited by
    #1

    Hi,
    I draw a painterpath of ellipse shape. How can I convert it to QPixmapItem?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      what about just drawing it a pixmap directly?
      int h = ui->label->height();
      int w = ui->label->width();
      QPixmap pix(w, h);
      QPainter paint(&pix);
      pix.fill( Qt::white );
      // painter path
      paint.end();

      Then you have pixmap and can make item.

      S 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        what about just drawing it a pixmap directly?
        int h = ui->label->height();
        int w = ui->label->width();
        QPixmap pix(w, h);
        QPainter paint(&pix);
        pix.fill( Qt::white );
        // painter path
        paint.end();

        Then you have pixmap and can make item.

        S Offline
        S Offline
        samdol
        wrote on last edited by
        #3

        @mrjj

        Thank you. That could do the job.

        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
        • Unsolved