Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Need startSystem Move and startSystemResize method, upgrade Qt from 5.13.2 to 5.15.2. However, QWebEnginePage::runJavaScript cannot run in QThread after the upgrade. It runs fine on 5.13.2
Qt 6.12 LTS is out! See what's new in the release blog

Need startSystem Move and startSystemResize method, upgrade Qt from 5.13.2 to 5.15.2. However, QWebEnginePage::runJavaScript cannot run in QThread after the upgrade. It runs fine on 5.13.2

Scheduled Pinned Locked Moved Solved QtWebEngine
3 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cisordeng
    wrote on last edited by cisordeng
    #1

    Just like the title, I upgraded Qt from 5.13.2 to 5.15.2 because I wanted to use 5.15 startSystemMove and startSystemResize, but I couldn't run QWebEnginePage::runJavaScript on QThread after the upgrade. It worked well in 5.13.2. This is a small example to reproduce my problem. Any suggestions or help would be greatly appreciated. Or the suggestion to move startSystemMove and startSystemResize from Qt5.15.2 to Qt5.13.2

    #include <QThread>
    #include <QApplication>
    #include <QMainWindow>
    #include <QWebEngineView>
    #include <QUrl>
    #include <QDebug>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QMainWindow window;
        auto *browser = new QWebEngineView();
        browser->load(QUrl("https://forum.qt.io/"));
        window.setCentralWidget(browser);
        auto *downloadThread = QThread::create([&]() {
            qDebug()<<"start thread";
            browser->page()->runJavaScript("console.error('download in thread');");
            qDebug()<<"end thread";
        });
        downloadThread->start();
        window.show();
        return QApplication::exec();
    }
    

    In Qt5.15.2 output:

    start thread
    13:49:47: The program has unexpectedly finished.
    13:49:47: The process was ended forcefully.
    

    In Qt5.13.2 output:

    start thread
    end thread
    js: download in thread
    

    Any suggestions or help would be greatly appreciated.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cisordeng
      wrote on last edited by
      #2

      Or build Qt5.15.2 + QtWebEngine5.13.2 implementation?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cisordeng
        wrote on last edited by
        #3

        Temporarily use QWebEngineDownloadItem to achieve download

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved