I'm developing a GUI that embeds a web browser using QtWebEngineView. Whenever I add it, a scaling issue comes up. The pointer is not aligned correctly, and everything becomes fuzzy.
I have already looked at the problems referenced here, however I am still looking for a different solution:
PyQt5 QWebEngineView causes blurry/fuzzy scaling issue
PyQt WebEngineView interferes with MainMenu
The scaling issue does get fixed when I use main.showFullScreen() (but then my combobox doesn't show any options, however you can still chose them, though this isn't the immediate issue.) The other solution was to rollback the graphics driver but I didn't find it practical since I'm trying to distribute this application company wide.
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import QWebEngineView
import sys
import pandas as pd
districtDF = pd.read_csv('districts.csv')
distlist = []
class Web(QWebEngineView):
def load(self, url):
self.setUrl(QUrl(url))
class main_window(QMainWindow):
def __init__(self, *args, **kwargs):
super(main_window, self).__init__(*args, **kwargs)
self.setWindowTitle('Test')
self.setGeometry(50, 50, 600, 700)
layout = QVBoxLayout()
combo = QComboBox(self)
for x in districtDF['dist']:
combo.addItem(x)
combo.move(50,50)
combo.setGeometry(225, 50, 150, 30)
web = Web()
web.load("https://www.google.com/")
layout.addWidget(combo)
layout.addWidget(web)
widget = QWidget()
widget.setLayout(layout)
self.setCentralWidget(widget)
self.show()
app = QApplication(sys.argv)
main = main_window()
main.showFullScreen()
app.exec_()
Is there any way to fix this and be able to keep a windowed view?