Skip to content

QtWebEngine

Discussions and questions on QtWebEngine
1.3k Topics 4.0k Posts
  • 0 Votes
    10 Posts
    2k Views
    M
    This worked for me: web_view.page().settings().setAttribute(PySide6.QWebEngineCore.QWebEngineSettings.WebAttribute.ShowScrollBars,False)
  • Python QWebEngineView and QWebChannel

    Solved
    2
    0 Votes
    2 Posts
    715 Views
    T
    @TRIAEIOU Solved, I was missing @Slot: import sys, json from PySide6.QtCore import QObject, Slot from PySide6.QtWebChannel import QWebChannel from PySide6.QtWebEngineWidgets import QWebEngineView from PySide6.QtWidgets import QApplication class Py(QObject): @Slot(str, result=str) def msg(self, msg): print("py.msg: ", msg) return json.dumps("clicked") if __name__ == "__main__": app = QApplication(sys.argv) web = QWebEngineView() channel = QWebChannel(web) py = Py(app) channel.registerObject("py", py) web.page().setWebChannel(channel) web.setHtml(''' <html> <head> <script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script> <script type="text/javascript"> var pymsg new QWebChannel(qt.webChannelTransport, function(channel) { pymsg = function (msg, cb = Function.prototype) { channel.objects.py.msg(msg, (res) => cb(JSON.parse(res))) return false } }) </script> </head> <body> <button onclick="pymsg('button clicked', (res) => {alert(res)})">click me</button> </body> </html> ''') web.show() app.exec()
  • How can I convert html file to pdf

    Unsolved
    2
    0 Votes
    2 Posts
    341 Views
    JonBJ
    @Bhavith-C There are several ways you might do this. But if you are happy with that example code you can use it to read the HTML from a local file via a suitable URL. Where that code goes m_view->load(QUrl::fromUserInput(m_inputPath)); you should be able to change it to use QUrl QUrl::fromLocalFile(const QString &localFile) on, say, the full path to a specified local file.
  • PerformanceObserver can't go in callback

    Unsolved
    2
    0 Votes
    2 Posts
    224 Views
    R
    performance.measure No trigger
  • Multiple paths for baseUrl

    Unsolved
    1
    0 Votes
    1 Posts
    196 Views
    No one has replied
  • 0 Votes
    1 Posts
    416 Views
    No one has replied
  • Is it possible to use custom QScriptEngine in QScriptEngineView?

    Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied
  • Serial port connection

    Unsolved
    4
    0 Votes
    4 Posts
    389 Views
    JonBJ
    @Rumeysa_135 said in Serial port connection: I just wanted to use QtWebEngine as header. I'm sorry I don't know what this means. And QtWebEngine is used in widgets anyway. Either your question/use of serial port is to do with QtWebEngine (not sure how, but it's your question) or it is not and has absolutely nothing to do with web engine?
  • Broken CSS on a fresh build

    Solved
    2
    0 Votes
    2 Posts
    428 Views
    N
    I have finally found out what was the cause. In my PATH variable /usr/local/bin came before /usr/bin folder where Bison was pointing to version is 2.4, instead of /usr/bin's 2.7. Strangely QT didn't give any errors and Bison test has passed successfully with 2.4 version. After pointing to the newer 2.7 version everything worked fine.
  • QWebEngineview page rendering with stackoverflow or tripadvisor sites

    Unsolved
    1
    0 Votes
    1 Posts
    203 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • Chromium version support or Chromium security patches

    Unsolved
    1
    0 Votes
    1 Posts
    169 Views
    No one has replied
  • PHP Web Developer at pokieslab

    Unsolved
    2
    0 Votes
    2 Posts
    441 Views
    G
    Hmm... That is interesting.
  • Smartcard support in Qt

    Unsolved
    1
    0 Votes
    1 Posts
    347 Views
    No one has replied
  • A problem that has been bothering me for 7 months

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    K
    @JKSH said in A problem that has been bothering me for 7 months: This was in your error log. To fix it, install the Qt Positioning module. Following this, I fix it! Thanks
  • SimpleBrowser seems to freeze when resuming from screen saver

    Unsolved
    2
    1 Votes
    2 Posts
    333 Views
    W
    We fear that much knowledge about how the Qt framework produces the graphics as well as much time will be required to determine the core of this issue. So we thought about workarounds to get rid of that, by meaning of doing something that causes a "refresh" of the window when the display resumes from standby. During our recherche, we found following (to be done in the QMainWindow instance): qApp->processEvents(); update(); Unfortunately that didn't work (what surprise...). hide(); show(); or resize(...); // Change width and/or height for 1px or so Both of them worked, where hiding/showing the window may result in that users may see what is behind the browser (for a very short moment, of course). However, both of them seem to be a very amateurish way to do this. Do you have any other ideas how to force the graphics to be refreshed? Have much thanks in before, Yours Willy K.
  • Parsing a hexadecimal data and calculating checksum

    Unsolved
    9
    0 Votes
    9 Posts
    985 Views
    JonBJ
    @J-Hilk said in Parsing a hexadecimal data and calculating checksum: I think the OP's question is: "How do I take only 4 Bytes from my QByteArray, so that I can convert it into an int32?" @jsulm nope, it just exists when the size doesn't match So if you want to access 4 bytes (sizeof(int32)) for conversion use QByteArray QByteArray::mid(qsizetype pos, qsizetype len = -1) const. Otherwise if you want it to appear as an array of int32 (and you know byte ordering is correct) use reinterpret_cast<> to int array on the data.
  • How do i parse string arrays in qt?

    Solved
    8
    0 Votes
    8 Posts
    959 Views
    jsulmJ
    @Rumeysa_135 I gave you a link to a method to convert a hex string to an integer and @Emre-MUTLU gave you code to split a string into hex numbers. You should now be good to go and write what you need. If something is not clear then please ask concrete questions and provide more details.
  • Does Qt support the Clipboard API? How do I use it?

    Unsolved
    2
    0 Votes
    2 Posts
    677 Views
    R
    A bug? https://bugreports.qt.io/browse/QTBUG-77450
  • QTWebengine crash with: unable to find resource: 16079

    Unsolved
    3
    0 Votes
    3 Posts
    480 Views
    S
    I think it is Qt, becouse in resource_bundle.cc I find this: auto data_pack = std::make_unique<DataPack>(ui::SCALE_FACTOR_NONE); if (!locale_path.empty() && data_pack->LoadFromPath(locale_path)) { locale_resources_data_ = std::move(data_pack); } else { locale_resources_data_ = std::make_unique<DataPack>(ui::SCALE_FACTOR_NONE); } ```then (secondary_locale_resources_data_.get() && secondary_locale_resources_data_->GetStringPiece( static_cast<uint16_t>(resource_id), &data)) if false and thats why I get this error. My locale: LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= What is "DataPack" ?