Problem with SetIcon when using a png
-
Hello,
It's my first Post, so I hope I give you all the Informations you need. I am using pyside2 5.13.0 on Python 3.6.5 and install it with pip.
I write a Tool, where I have some QPushButtons. By User-Action, the displayed Icon has to be updated. I do that as followed:
/self.values[c_number][cnt].setIcon(QIcon(path))
When I'm using a JPG it's fine. But when I'm using a PNG, it didn't display anything. The Pushbutton turns grey and that is all.
Have you a suggestion what I can do?
I have tried the following, without any success:self.values[c_number][cnt].repaint() self.values[c_number][cnt].setIconSize(QSize(20,20)) self.values[c_number][cnt].setIconSize(QSize(80,80)) self.values[c_number][cnt].update()
Best regards
- Casisto
-
Hi and welcome to devnet,
Can you display that image on a QLabel ?
-
Can you start the application with the QT_DEBUG_PLUGINS environment variable set to 1 ?
See what is related to the image plugins.
-
Maybe not. Referring to doc.qt.io/qtforpython there is no Variable named „QT_DEBUG_PLUGINS“ and my shoots in the blue dosn‘t work.