Change Application icon using pywebview python

1.7k views Asked by At

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

There are 1 answers

0
shivjeet bhullar On

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'))