Questions tagged [qwebenginepage]

44 questions
1
vote
1 answer

How to modify a link url before it is navigated to

I want to catch a click on a page and add at the anchor link some text. For example, If the user click on an anchor with href mysite.com/about, I want modify the link in: mysite.com/about?myvar=value I used QWebEngineUrlRequestInterceptor but the…
michele
  • 26,348
  • 30
  • 111
  • 168
1
vote
1 answer

With QPrinter::HighResolution not printing

I implement the ability to print reports in my project. Reports are presented as HTML content. I use for print QWebEnginePage. I need high resolution print output for reports: QPrinter printer = new QPrinter(QPrinter::HighResolution); But when…
soaup
  • 23
  • 4
1
vote
1 answer

Calling Qt slot from JavaScript

I'm using a QWebEnginePage class for rendering my webpage. And i need to implement callback function. So first i want to register my slot in JS and call this slot from JS when it needed (for example, after click button on the webpage). I tried to do…
borune
  • 548
  • 5
  • 21
1
vote
0 answers

Python QWebEnginePage (PyQt5) crash

Hello everyone I just trying to use pyqt5 (I used python-3.5) to render html. I implemnted this class (Page) to do this tasks: #This is the Main.py. import sys from PyQt5.QtWebEngineWidgets import QWebEnginePage from PyQt5.QtWidgets import…
1
vote
1 answer

Qt WebEngine incorrect page margins when printing

I implement the ability to print reports in my project. Reports are presented as HTML content. There is an instance of QPrinter with custom fields: printer = new QPrinter(QPrinter::ScreenResolution); qreal topMargin = 15; qreal bottomMargin =…
soaup
  • 23
  • 4
1
vote
1 answer

Cannot use QUrl

I am trying to learn Dynamic Web scraping on PyQt5. I was looking up the tutorials meant for PyQt4 so have some different libraries in Qt5. import sys from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import QUrl from…
K. Tejas
  • 13
  • 3
1
vote
0 answers

Get the text or title from a clicked link in QWebEnginePage

So, the question is on using QWebEngineView or QWebEnginePage, or something like that. I have a link which looks like Salt. I have already managed to intercept clicking on this link and force QWebEngineView to do nothing with it…
V.Nosov
  • 93
  • 3
  • 10
0
votes
1 answer

Program on PyQt5 + QWebEngineView closes when loading youtube.music site

The program on PyQt5 + QWebEngineView closes when loading youtube.music site after about 3-4 seconds after opening, without any error, while any other site loads without any problems and the program does not close itself. This problem started today,…
0
votes
0 answers

The size of pdf generated by QWebEnginePage is too big when the html consists of chinese characters

I am using PyQt5 with QWebEnginePage to convert a html to pdf. The html is generated from Google Docs by exporting a document as html, and the html consists of some chinese characters. The size of the html file is around 44KB and it does not include…
Danny Lau
  • 143
  • 1
  • 7
0
votes
0 answers

QWebEngine: export HTML pages > 2 MB to PDF

I’m facing an issue while displaying an HTML page (that I dynamically built) within QWebEngine because, as indicated in the doc here (https://doc.qt.io/qt-6/qwebengineview.html#setHtml), content larger than 2 MB cannot be displayed directly using…
P G
  • 43
  • 3
0
votes
1 answer

Clicking links with the middle mouse button in Python3/Qt6

I used a Python3 script under GTK, where I clicked on a link with the left mouse button to open it in the same window and on a middle mouse button to open it in a separate window. I am now in the process of migrating this script from GTK to Qt6. The…
nst0022
  • 407
  • 2
  • 11
0
votes
0 answers

How to display (custom) icons for pageActions linked to a QWebEngineView in PyQt6?

After upgrading to PyQt6, pageActions are now shown as text instead of icons. How do I get them to show as icons again? Is it possible to define custom icons instead? Code to reproduce is given below. import sys # pageAction with icons from…
dukeeloo
  • 161
  • 7
0
votes
0 answers

Displaying PDF in PyQt5 QWebEngineView and getting content of non-url links

I use PyQt5.QtWebEngineWidgets to display a pdf. In this pdf I added links over certain words with PyMuPDF. The links are created with this code: def create_pdf_with_links(): doc = fitz.open("test.pdf") for count, page in enumerate(doc): …
Mazze
  • 383
  • 3
  • 13
0
votes
0 answers

How to close QWebEnginePage (Python)

I am using QWebEnginePages as tabs in my QWebEngineView and my question is how to properly close the QWebEnginePage? I can't find any solution, I searched in Stackoverflow, Google, Qt docs and some other sites.
0
votes
0 answers

how to get html source code from QWebEnginePage in pyqt5

I am trying to get html code from the url with QWebEnginePage and QWebEngineView. i found this answer but realy dont undrsestad the syntax. get HTML from QWebEnginePage in QWebEngineView using Lamda so my question is how can i get html source code…
Qasim
  • 83
  • 10