Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Some Websites not load in QWebViewEngine QT 5.12.0

Some Websites not load in QWebViewEngine QT 5.12.0

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 2.7k Views 1 Watching
  • 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.
  • AmrCoderA Offline
    AmrCoderA Offline
    AmrCoder
    wrote on last edited by
    #1

    Hello,

    Iam using QT 5.12.0 with Visual Studio 2017 32 bit, I want to view the WhatsApp website which is here, inside the QT webview engine, but I got this message,

    WhatsApp works with Google Chrome 36+
    To use WhatsApp, update Chrome or use Mozilla Firefox, Safari, Microsoft Edge orOpera.
    UPDATE GOOGLE CHROME
    

    so is there any solution to make this work? such as updating the current chromium or any other solution?

    Thanks in advance.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Looks like you're looking for QWebEngineProfile::setHttpUserAgent

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • AmrCoderA Offline
        AmrCoderA Offline
        AmrCoder
        wrote on last edited by
        #3

        can you give me an example of how to use it? I already checked my current User Agent and it's

        "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.0 Chrome/69.0.3497.128 Safari/537.36"
        

        what should i set it to? I found a website here have some user Agent which one should I use to work?
        also I tried to use it in this way i don't no if it's correct and will active user agent on all the pages or not

        in the constructor of the main window i do this

        MainWindow::MainWindow(QWidget *parent) :
            QMainWindow(parent),
            ui(new Ui::MainWindow)
        {
            ui->setupUi(this);
            QWebEnginePage *page = ui->widget->page();
            qDebug() << page->profile()->httpUserAgent();
        page->profile()->sethttpuserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36");
            connect(ui->widget, SIGNAL(loadProgress(int)), this, SLOT(LoadProgress(int)));
        }
        
        1 Reply Last reply
        0
        • AmrCoderA Offline
          AmrCoderA Offline
          AmrCoder
          wrote on last edited by AmrCoder
          #4

          @Christian-Ehrlicher Thank you it worked :D i tried the above code and it worked already with me, with the current User Agent I added, I have a small problem it worked with me once and now it not work anymore when I run it again!, strange problem? please, any help with this?, i did not change anything the same code, but not working on the second run

          1 Reply Last reply
          0
          • AmrCoderA Offline
            AmrCoderA Offline
            AmrCoder
            wrote on last edited by
            #5
            This post is deleted!
            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