Results 1 to 4 of 4

Thread: QPushButton image doesn't show transparency

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2013
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPushButton image doesn't show transparency

    Hi,

    I want to add an image to QPushButton for "normal" state and an image for "pressed" state by using StyleSheets. The issue I am having is that transparency of the image doesn't seem to work well, I see the square shape of the icon even though the icon is completely transparent.
    Does anyone have a an idea why this is happening ?

    Here is my stylesheet code and a screenshot of the QPushButton. You can see the square with slightly different color than the background, almost as if it's partially transparent.

    Qt Code:
    1. QPushButton#settingsButton {
    2. image: url(transparent_icon.png);
    3. border:none;
    4. outline:none;
    5. width: 64px;
    6. height: 64px;
    7. }
    8.  
    9.  
    10. QPushButton#settingsButton:pressed {
    11. image: url(transparent_icon.png);
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. QPushButton doesn't show with a particular text.
    By bwnicewo in forum Qt Programming
    Replies: 0
    Last Post: 30th July 2013, 21:09
  2. Transparency doesn't work in building Qt from sources
    By AspiringEngineer in forum Qt Programming
    Replies: 0
    Last Post: 18th June 2013, 14:31
  3. QPushButton Icon opacity/transparency
    By vladozar in forum Qt Programming
    Replies: 2
    Last Post: 26th November 2012, 16:45
  4. Replies: 9
    Last Post: 8th November 2011, 15:54
  5. Replies: 3
    Last Post: 8th September 2011, 15:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.