Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QT5.7.1 cannot load websites built on react.js

QT5.7.1 cannot load websites built on react.js

Scheduled Pinned Locked Moved Unsolved Qt WebKit
7 Posts 4 Posters 194 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.
  • V Offline
    V Offline
    Vbrg
    wrote on last edited by
    #1

    I am using QT5.7.1 webkit for displaying Web Page developed in React.js (React version 18.3.1 and Node version 22.0.0) on connected HMI through linuxfb. But Getting blank white page.

    Below is my simple code

    #include <QApplication>
    #include <QMainWindow>
    #include <QWebView>
    #include <QUrl>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        // Create the main window
        QMainWindow mainWindow;
        mainWindow.setGeometry(0, 0, 1280, 800);  // Set position and size
    
        // Add a web view
        QWebView* webView = new QWebView(&mainWindow);
        webView->setGeometry(0, 0, 1280, 800);
        webView->load(QUrl("http://localhost:3000/react"));  // Load the URL
        mainWindow.show();  // Show the main window
        return app.exec();
    }
    

    Setting below ENV's:

    export QT_QPA_PLATFORM=linuxfb
    export LD_LIBRARY_PATH=/usr/local/qt5.7.1/lib
    export QT_PLUGIN_PATH=/usr/local/qt5.7.1/plugins
    export QTDIR=/usr/local/qt5.7.1
    

    Below is platform Details:

    Debian 11
    ARMv7 32-bit
    

    If any help would be appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      The first thing to do would be to update Qt. 5.7.1 has reached end of life a long time ago. Also, that outdated WebKit version is likely too old to support the modern JavaScript stuff.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • V Offline
        V Offline
        Vbrg
        wrote last edited by
        #3

        Actually, we recently updated our web page, which was originally built with Angular 1, to a new design using React.js (ES6) and CSS. We considered using Qt6.4.2 WebEngine to display this React-based page within our application, but we're facing performance issues. Specifically, the WebEngine is consuming an unusually high amount of CPU resources (around 200%), and this is occurring because we do not have hardware acceleration (GPU).

        Given that we are exclusively looking to use Qt (no external browsers or additional setups), we want to explore if there is a way to render our React.js web page without relying on WebEngine, while keeping the rest of the functionality within Qt.

        Is there any other approach or alternative Qt component that would allow us to display a modern web page (React.js and CSS) efficiently, without running into the high resource consumption issues associated with WebEngine?

        Thanks in advance for any insights!

        JonBJ 1 Reply Last reply
        0
        • V Vbrg

          Actually, we recently updated our web page, which was originally built with Angular 1, to a new design using React.js (ES6) and CSS. We considered using Qt6.4.2 WebEngine to display this React-based page within our application, but we're facing performance issues. Specifically, the WebEngine is consuming an unusually high amount of CPU resources (around 200%), and this is occurring because we do not have hardware acceleration (GPU).

          Given that we are exclusively looking to use Qt (no external browsers or additional setups), we want to explore if there is a way to render our React.js web page without relying on WebEngine, while keeping the rest of the functionality within Qt.

          Is there any other approach or alternative Qt component that would allow us to display a modern web page (React.js and CSS) efficiently, without running into the high resource consumption issues associated with WebEngine?

          Thanks in advance for any insights!

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @Vbrg
          Did you test your page in Chrome browser, quite outside of Qt/webengine?
          Did you test with a release build of your code/Qt libraries? QtWebEngine is known to be slow in debug builds.

          V 1 Reply Last reply
          0
          • J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote last edited by
            #5

            Personally I would consider this a feature 🤣


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • JonBJ JonB

              @Vbrg
              Did you test your page in Chrome browser, quite outside of Qt/webengine?
              Did you test with a release build of your code/Qt libraries? QtWebEngine is known to be slow in debug builds.

              V Offline
              V Offline
              Vbrg
              wrote last edited by
              #6

              @JonB
              Yes, we tested the page in both Chrome and other browsers. In Chrome, the CPU usage was similar to what we observed with Qt WebEngine — relatively high. Interestingly, when testing with a lightweight browser like Surf, the performance was noticeably better, with approximately 50% lower CPU utilization compared to Chrome. However, with Surf, the CPU utilization still fluctuated between 100% to 150%, which is still high for my system.

              As for our Qt setup, we installed Qt 6.4.2 using the system package manager, so it should be the release build.

              JonBJ 1 Reply Last reply
              0
              • V Vbrg

                @JonB
                Yes, we tested the page in both Chrome and other browsers. In Chrome, the CPU usage was similar to what we observed with Qt WebEngine — relatively high. Interestingly, when testing with a lightweight browser like Surf, the performance was noticeably better, with approximately 50% lower CPU utilization compared to Chrome. However, with Surf, the CPU utilization still fluctuated between 100% to 150%, which is still high for my system.

                As for our Qt setup, we installed Qt 6.4.2 using the system package manager, so it should be the release build.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by
                #7

                @Vbrg So in a word Qt only offers integrated browser with chromium/Qt web engine.

                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 Extensions
                • Unsolved