Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved qwebview unable to load page only one page

    Qt WebKit
    2
    4
    1220
    Loading More Posts
    • 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.
    • petrzmax
      petrzmax last edited by petrzmax

      Hi!
      I'm working on some app which will collect data from site https://olimp.us/.
      I have OpenSSl installed and plugins, and java scripts are turned on. I also use latest User agent. But when i'm trying to load this page, there is only a white page.
      Any suggestion what should I turn on or something?
      Thanks for help.

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @petrzmax last edited by A Former User

        @petrzmax Hi! Just tested with minimal code and QtWebEngine and that works:

        import QtQuick 2.5
        import QtQuick.Controls 1.4
        import QtWebEngine 1.3
        
        ApplicationWindow {
            visible: true
            width: 600
            height: 400
        
            WebEngineView {
                anchors.fill: parent
                url: "https://olimp.us/"
            }
        }
        

        Maybe you can show us some of your code so we can try to figure out what's going wrong.

        1 Reply Last reply Reply Quote 0
        • petrzmax
          petrzmax last edited by petrzmax

          Hi, thanks for reply!
          I have a widget called QWebview, so its added in designer, but here is the code:

          MainWindow::MainWindow(QWidget *parent) :
              QMainWindow(parent),
              ui(new Ui::MainWindow)
          {
              ui->setupUi(this);
              QWebSettings *settings = QWebSettings::globalSettings();
              settings->setAttribute(QWebSettings::JavascriptEnabled, true);
              settings->setAttribute(QWebSettings::PluginsEnabled, true);
              settings->setAttribute(QWebSettings::AutoLoadImages, true);
              settings->setAttribute(QWebSettings::JavaEnabled, true);
              settings->setAttribute(QWebSettings::JavascriptCanOpenWindows, false);
          
          
              ui->webView->load(QUrl("https://olimp.us/"));
              //ui->customPlot->yAxis->setRange(1.0,1.2);
              //ui->customPlot->yAxis->setLabel(QString("CT/T kills"));
          }
          

          Maybe it's because I use old version of Qt? I have just installed Qt 5.7 but there is no QWebview widget.

          Edit: Ok, so it's not working on Mingw compiler. I will try on Vs 2015

          Edit v2: Thanks porting it to QwebEngine solved my problem.

          ? 1 Reply Last reply Reply Quote 0
          • ?
            A Former User @petrzmax last edited by

            @petrzmax Glad to hear you solved it. Please use the "topic tools" button to mark this thread as solved. Cheers!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post