so i've been trying to render an animated icon in a QPushButton.
I tried to implement this method to pyside6 but still nothing. I only have the button and text without icon. Here is the code:
def update_ani(self):
self.button.setIcon(QIcon(self.icon.currentPixmap()))
def display_cursor(self):
if os.path.splitext(self.file_path)[1] == '.cur':
icon = QPixmap(self.file_path)
self.button = QPushButton(icon=icon, text=os.path.basename(self.file_path))
else:
icon = QMovie(self.file_path)
icon.frameChanged.connect(update_ani)
self.button = QPushButton(icon=QIcon(icon.currentPixmap()), text=os.path.basename(self.file_path))
icon.start()
Any founds ?