0

I am making an app with the code from This Stackoverflow page:

import sys
from PyQt5 import QtWidgets,QtGui,QtCore
from PyQt5.QtWebEngineWidgets import *
app=QtWidgets.QApplication(sys.argv)
w=QWebEngineView()
w.load(QtCore.QUrl('https://google.com')) ## load google on startup
w.showMaximized()
app.exec_()

However,the result look like this

Click to see

Where there is a title "pythonw"

However,I want to change it to "My App",how can I?

1 Answers1

0

You just need to use "setWindowTitle":

import sys
from PyQt5 import QtWidgets,QtGui,QtCore
from PyQt5.QtWebEngineWidgets import *

app=QtWidgets.QApplication(sys.argv)
w=QWebEngineView()
w.load(QtCore.QUrl('https://google.com')) ## load google on startup
w.setWindowTitle("pythonw")
w.showMaximized()
app.exec_()

PD: This question is answered here too but is not in python, that is why I took my time to reply and not to flag this post.

WhoKnowsMe
  • 498
  • 2
  • 13