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. Semi-transparent box around QPixmap PNG that has transparency
Forum Updated to NodeBB v4.3 + New Features

Semi-transparent box around QPixmap PNG that has transparency

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 136 Views
  • 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.
  • M Offline
    M Offline
    minorsecond
    wrote on last edited by
    #1

    I'm trying to display a png that has a transparent background in a label in a dialog box. Here is my code:

    About::About(QWidget *parent) {
        /*
         * About app dialog
         */
    
        ui.setupUi(this);
        this->setFixedSize(230, 252);
        QPixmap pixmap("../Resources/mini-icon.png");
        ui.miniIcon->setPixmap(pixmap);
        ui.miniIcon->repaint();
    }
    

    This dialog window displays correctly, but there is a barely discernible box around the png (shown below). I've verified that the png is indeed transparent in Photoshop. The dimensions of the semi-transparent box are the same as that of the image file. Have I missed a step?

    Screen Shot 2020-09-16 at 10.13.21 AM.png

    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