Problem facing while loading html ( QtWebEngineWidgets)
Unsolved
Qt for Python
-
I am trying to load Html in QFrame, I worked but
output is so smallHow do I fix ??
from PyQt5 import QtWidgets, uic, QtWebEngineWidgets, QtCore import sys, os, webbrowser class Ui(QtWidgets.QMainWindow): def __init__(self): super(Ui, self).__init__() uic.loadUi('untitled.ui', self) self.show() # Show the GUI #Load Html self.webEngineView = QtWebEngineWidgets.QWebEngineView(self.image_slide) self.webEngineView.load(QtCore.QUrl().fromLocalFile(os.path.split(os.path.abspath(__file__))[0] + r'\html\index.html')) # Screen Switch def change_pg0(): self.stackedWidget.setCurrentIndex(0) def change_pg1(): self.stackedWidget.setCurrentIndex(1) self.btn_next.clicked.connect(change_pg1) self.btn_back.clicked.connect(change_pg0) # Exit def exit_appx(): sys.exit(app.exec_()) # Image Button self.btn_exit.clicked.connect(exit_appx) self.btn_exit_2.clicked.connect(exit_appx) self.btn_discord.clicked.connect(lambda: webbrowser.open('https://discord.gg/cjFYAdBNMU')) self.btn_github.clicked.connect(lambda: webbrowser.open('https://github.com/Calinix-Team')) self.btn_sourceforge.clicked.connect(lambda: webbrowser.open('https://sourceforge.net/projects/calinixos/')) self.btn_youtube.clicked.connect( lambda: webbrowser.open('https://www.youtube.com/channel/UCyyXcHm8UswsF0cjOX6fMng')) self.btn_telegram.clicked.connect(lambda: webbrowser.open('https://discord.gg/cjFYAdBNMU')) self.btn_reddit.clicked.connect(lambda: webbrowser.open('https://reddit.com/r/CalinixOS')) # Button self.btn_guide.clicked.connect(lambda: webbrowser.open('https://calinixos-wiki.readthedocs.io/en/latest/')) self.btn_website.clicked.connect(lambda: webbrowser.open('https://get.calinix.tech/')) self.btn_involved.clicked.connect(lambda: webbrowser.open('https://get.calinix.tech/get-involved.html')) self.btn_mail.clicked.connect(lambda: webbrowser.open('mailto:contact@calinix.tech')) self.btn_donate.clicked.connect(lambda: webbrowser.open('https://www.buymeacoffee.com/team.calinix')) self.btn_wiki.clicked.connect(lambda: webbrowser.open('https://calinixos-wiki.readthedocs.io/en/latest/')) app = QtWidgets.QApplication(sys.argv) window = Ui() app.exec_()
-
@shashankx86 Either use layouts to size and position your widget properly or at least resize everything as you like.
-
@shashankx86 Qt documentation can: https://doc.qt.io/qt-5/layout.html
-
@shashankx86 and if you want a Python example using it,
PySide
has a couple of examples in the documentation page, like https://doc.qt.io/qtforpython/examples/example_widgets_layouts_basiclayouts.html?highlight=layout