Change Application icon using pywebview python

Viewed 474

I have created a GUI application using pywebview in python and want to change application icon shown in menu bar, By default it is shown as python icon in windows. I am new to this library and want to change default icon to custom icon so is there any way to do this?

1 Answers

In the PyWebView framework if you are using the QT web engine as GUI then you have to add a window icon manually in the site packages "\Python39\Lib\site-packages\webview\platforms\qt.py" file. Simply paste the code given below into class BrowserView Class Decorator init().

   class BrowserView(QMainWindow):
      def __init__(self, window):
        from PyQt5 import QtGui
        self.setWindowIcon(QtGui.QIcon('icon.ico'))
Related