-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Working code:
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
import iconify as ico
class Window(QtWidgets.QWidget):
def __init__(self, parent=None):
super().__init__()
layout = QtWidgets.QVBoxLayout(self)
button = QtWidgets.QPushButton('OK')
# icon = ico.Icon('delete', color=QtGui.QColor('blue'))
# button.setIcon(icon)
button.setIcon(QtGui.QIcon("resources/icons/eye.svg")) # 1
layout.addWidget(button)
if __name__ == "__main__":
app = QtWidgets.QApplication([])
w = Window()
w.show()
sys.exit(app.exec_())
But if I uncomment the two lines instead of the line with comment 1, I immediately get the following error:
TypeError: setIcon(self, QIcon): argument 1 has unexpected type 'PySide2.QtGui.QIcon'
I really liked the program, its ability to work with SVG directly and suddenly such OPS !!!
What am I doing wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels