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. Using QWebkit for windows with mingw
Forum Updated to NodeBB v4.3 + New Features

Using QWebkit for windows with mingw

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 5 Posters 3.9k Views 4 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.
  • Thank YouT Thank You

    @artwaw

    How did you install those precompiled binaries?

    I just copied all files and moved to C:/Qt/Qt5.12.8/5.12.8/mingw73_32/ for 32 bit and on 64 bit C:/Qt/Qt5.12.8/5.12.8/mingw73_32/

    web.pro

    QT       += core gui webkitwidgets
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    

    mainwindow.h

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include<QWebView>
    #include<QtWebKit/QtWebKit>
    #include<QtWebChannel/QWebChannel>
    #include<QVBoxLayout>
    
    
    QT_BEGIN_NAMESPACE
    namespace Ui { class MainWindow; }
    QT_END_NAMESPACE
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
         QWebView *view ;
         QVBoxLayout *layout;
         QWidget *wid;
    };
    #endif // MAINWINDOW_H
    
    

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include<QHBoxLayout>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        wid = new QWidget();
        layout = new QVBoxLayout(wid);
    
    
        view = new QWebView(this);
        view->load(QUrl("https://google.com"));
        layout->addWidget(view);
    
        wid->setLayout(layout);
        setCentralWidget(wid);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    
    

    I hope it's correct 😂😂😂

    artwawA Offline
    artwawA Offline
    artwaw
    wrote on last edited by
    #8

    @Thank-You said in Using QWebkit for windows with mingw:

    I just copied all files and moved to C:/Qt/Qt5.12.8/5.12.8/mingw73_32/ for 32 bit and on 64 bit C:/Qt/Qt5.12.8/5.12.8/mingw73_32/

    what

    For more information please re-read.

    Kind Regards,
    Artur

    1 Reply Last reply
    0
    • Thank YouT Thank You

      @artwaw

      How did you install those precompiled binaries?

      I just copied all files and moved to C:/Qt/Qt5.12.8/5.12.8/mingw73_32/ for 32 bit and on 64 bit C:/Qt/Qt5.12.8/5.12.8/mingw73_32/

      web.pro

      QT       += core gui webkitwidgets
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++11
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
          main.cpp \
          mainwindow.cpp
      
      HEADERS += \
          mainwindow.h
      
      FORMS += \
          mainwindow.ui
      

      mainwindow.h

      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      #include<QWebView>
      #include<QtWebKit/QtWebKit>
      #include<QtWebChannel/QWebChannel>
      #include<QVBoxLayout>
      
      
      QT_BEGIN_NAMESPACE
      namespace Ui { class MainWindow; }
      QT_END_NAMESPACE
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          MainWindow(QWidget *parent = nullptr);
          ~MainWindow();
      
      private:
          Ui::MainWindow *ui;
           QWebView *view ;
           QVBoxLayout *layout;
           QWidget *wid;
      };
      #endif // MAINWINDOW_H
      
      

      mainwindow.cpp

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      #include<QHBoxLayout>
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          wid = new QWidget();
          layout = new QVBoxLayout(wid);
      
      
          view = new QWebView(this);
          view->load(QUrl("https://google.com"));
          layout->addWidget(view);
      
          wid->setLayout(layout);
          setCentralWidget(wid);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      
      

      I hope it's correct 😂😂😂

      artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #9

      @Thank-You also if I am not mistaken you need not only webkitwidgets - I have a program that uses webkit as w page viewer, written some time ago, but its pro file had to have Qt += webkitwidgets webkit together to work properly. I am not certain if this might be the case but please try, as I said it was some time ago.

      For more information please re-read.

      Kind Regards,
      Artur

      Thank YouT 1 Reply Last reply
      0
      • artwawA artwaw

        @Thank-You also if I am not mistaken you need not only webkitwidgets - I have a program that uses webkit as w page viewer, written some time ago, but its pro file had to have Qt += webkitwidgets webkit together to work properly. I am not certain if this might be the case but please try, as I said it was some time ago.

        Thank YouT Offline
        Thank YouT Offline
        Thank You
        wrote on last edited by Thank You
        #10

        @artwaw said in Using QWebkit for windows with mingw:

        you need not only webkitwidgets

        Sorry, I was trying to tweak things if it will work after you asked about .pro file. I had actually have both

        what

        What Should I do?
        Isn't it correct.
        https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-build/18

        Let's make QT free or It will go forever

        TRUE AND FALSE <3

        artwawA 1 Reply Last reply
        0
        • Thank YouT Thank You

          @artwaw said in Using QWebkit for windows with mingw:

          you need not only webkitwidgets

          Sorry, I was trying to tweak things if it will work after you asked about .pro file. I had actually have both

          what

          What Should I do?
          Isn't it correct.
          https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-build/18

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by
          #11

          @Thank-You Just to make sure: you copied 32bit files to 32bit mingw at mingw73_32 (which makes sense) and then you copied 64bit files to 32bit mingw folder, possibly overwriting 32bit libraries copied previously?

          For more information please re-read.

          Kind Regards,
          Artur

          Thank YouT 1 Reply Last reply
          0
          • artwawA artwaw

            @Thank-You Just to make sure: you copied 32bit files to 32bit mingw at mingw73_32 (which makes sense) and then you copied 64bit files to 32bit mingw folder, possibly overwriting 32bit libraries copied previously?

            Thank YouT Offline
            Thank YouT Offline
            Thank You
            wrote on last edited by Thank You
            #12

            @artwaw
            Single option is given:
            qtwebkit-Windows-Windows_10-Mingw73-Windows-Windows_10-X86_64.7z

            So I copied same things to both directories.

            ba573a5c-2872-4855-8292-6b80fb324a2b-image.png
            This is bin folder. It doesn't have any differences

            and others are also same. Files aren't seperated

            Let's make QT free or It will go forever

            TRUE AND FALSE <3

            artwawA 1 Reply Last reply
            0
            • Thank YouT Thank You

              @artwaw
              Single option is given:
              qtwebkit-Windows-Windows_10-Mingw73-Windows-Windows_10-X86_64.7z

              So I copied same things to both directories.

              ba573a5c-2872-4855-8292-6b80fb324a2b-image.png
              This is bin folder. It doesn't have any differences

              and others are also same. Files aren't seperated

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on last edited by
              #13

              @Thank-You said in Using QWebkit for windows with mingw:

              X86_64.7z

              Those are 64bit binaries. They will not work if you compile for 32bit target.

              For more information please re-read.

              Kind Regards,
              Artur

              Thank YouT 1 Reply Last reply
              0
              • artwawA artwaw

                @Thank-You said in Using QWebkit for windows with mingw:

                X86_64.7z

                Those are 64bit binaries. They will not work if you compile for 32bit target.

                Thank YouT Offline
                Thank YouT Offline
                Thank You
                wrote on last edited by
                #14

                @artwaw

                Ok But compiling with 64 bit also gives error on both debug and release.(Mentioned at the main post)
                What about it?
                Where can I get 32bit binaries?

                Let's make QT free or It will go forever

                TRUE AND FALSE <3

                artwawA 1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #15

                  @Thank-You said in Using QWebkit for windows with mingw:

                  Where can I get 32bit binaries?

                  On the same link from above I would guess.

                  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
                  0
                  • Thank YouT Thank You

                    @artwaw

                    Ok But compiling with 64 bit also gives error on both debug and release.(Mentioned at the main post)
                    What about it?
                    Where can I get 32bit binaries?

                    artwawA Offline
                    artwawA Offline
                    artwaw
                    wrote on last edited by
                    #16

                    @Thank-You said in Using QWebkit for windows with mingw:

                    But compiling with 64 bit also gives error on both debug and release.(Mentioned at the main post)

                    Hardly a surprise if you did not copy the 64bit binaries to the 64bit part of Qt tree.

                    For more information please re-read.

                    Kind Regards,
                    Artur

                    Thank YouT 1 Reply Last reply
                    0
                    • artwawA artwaw

                      @Thank-You said in Using QWebkit for windows with mingw:

                      But compiling with 64 bit also gives error on both debug and release.(Mentioned at the main post)

                      Hardly a surprise if you did not copy the 64bit binaries to the 64bit part of Qt tree.

                      Thank YouT Offline
                      Thank YouT Offline
                      Thank You
                      wrote on last edited by
                      #17

                      @artwaw
                      I tried using windows 7 32bit binaries in 32 bit and it compiled but shows message

                      The program has unexpectedly finished.
                       The process was ended forcefully.
                      

                      I couldn't make it working

                      Let's make QT free or It will go forever

                      TRUE AND FALSE <3

                      artwawA 1 Reply Last reply
                      0
                      • Thank YouT Thank You

                        @artwaw
                        I tried using windows 7 32bit binaries in 32 bit and it compiled but shows message

                        The program has unexpectedly finished.
                         The process was ended forcefully.
                        

                        I couldn't make it working

                        artwawA Offline
                        artwawA Offline
                        artwaw
                        wrote on last edited by
                        #18

                        @Thank-You You can try to use a Dependency Walker tool to identify what's missing.

                        For more information please re-read.

                        Kind Regards,
                        Artur

                        Thank YouT 1 Reply Last reply
                        1
                        • artwawA artwaw

                          @Thank-You You can try to use a Dependency Walker tool to identify what's missing.

                          Thank YouT Offline
                          Thank YouT Offline
                          Thank You
                          wrote on last edited by
                          #19

                          @artwaw
                          I used it. Found out libxml2-2.dll libxslt-1.dll were not present after running windeployqt. So I copied them to executable directory.
                          After that it shows this error.
                          5fa602c9-54bc-4945-a3b3-cd46b918ec9b-image.png

                          Let's make QT free or It will go forever

                          TRUE AND FALSE <3

                          JKSHJ 1 Reply Last reply
                          0
                          • Thank YouT Thank You

                            @artwaw
                            I used it. Found out libxml2-2.dll libxslt-1.dll were not present after running windeployqt. So I copied them to executable directory.
                            After that it shows this error.
                            5fa602c9-54bc-4945-a3b3-cd46b918ec9b-image.png

                            JKSHJ Offline
                            JKSHJ Offline
                            JKSH
                            Moderators
                            wrote on last edited by
                            #20

                            @Thank-You said in Using QWebkit for windows with mingw:

                            5fa602c9-54bc-4945-a3b3-cd46b918ec9b-image.png

                            Qt5WebKitWidgets.dll is looking for QtPrivate::argToQString(QStringView), which is present in recent versions of Qt Core.

                            It sounds like the latest Qt WebKit binaries are built against Qt 5.14:

                            • https://forum.qt.io/post/689916
                            • https://github.com/qtwebkit/qtwebkit/releases/tag/qtwebkit-5.212.0-alpha4

                            Can you update to Qt 5.14 or Qt 5.15?

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            Thank YouT 1 Reply Last reply
                            0
                            • JKSHJ JKSH

                              @Thank-You said in Using QWebkit for windows with mingw:

                              5fa602c9-54bc-4945-a3b3-cd46b918ec9b-image.png

                              Qt5WebKitWidgets.dll is looking for QtPrivate::argToQString(QStringView), which is present in recent versions of Qt Core.

                              It sounds like the latest Qt WebKit binaries are built against Qt 5.14:

                              • https://forum.qt.io/post/689916
                              • https://github.com/qtwebkit/qtwebkit/releases/tag/qtwebkit-5.212.0-alpha4

                              Can you update to Qt 5.14 or Qt 5.15?

                              Thank YouT Offline
                              Thank YouT Offline
                              Thank You
                              wrote on last edited by
                              #21

                              @JKSH
                              Hey, I have been using Qt5.12.8 and has other dependencies too.
                              Will code compiling in Qt 5.12.8 would compile in QT 5.15 ???

                              Let's make QT free or It will go forever

                              TRUE AND FALSE <3

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

                                Yes, that's one of the strength of Qt.

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

                                Thank YouT 1 Reply Last reply
                                1
                                • SGaistS SGaist

                                  Yes, that's one of the strength of Qt.

                                  Thank YouT Offline
                                  Thank YouT Offline
                                  Thank You
                                  wrote on last edited by Thank You
                                  #23

                                  I installed QT 5.15.2 and build with it. Got all dependencies with windeployqt and added libxml2-2.dll libxslt-1.dll.
                                  It now shows error zlib1__.dll not found.
                                  I searched in whole qt directory but couldn't find one so I managed to download zlib1.dll not zlib1__.dll from dll-files.com.
                                  I renamed zlib1.dll to zlib1__.dll and placed in binary directory. I don't know if this is good to do.
                                  Where is zlib1__.dll located in QT??? OR it isn't related with QT?

                                  Atleast it is working in 64bit version but shows TLS initialization failed Which is connected to OpenSSL so I am sure I will solve this problem.
                                  Edit:
                                  I copied libcrypto-3-x64.dll and libssl-3-x64.dll to executable directory but couldn't get it working
                                  Now some problems that I can't figure out are:
                                  It doesn't work with debug
                                  Most importantly it doesn't work with 32 bit which is most for me.
                                  How can I obtain it?

                                  Let's make QT free or It will go forever

                                  TRUE AND FALSE <3

                                  Thank YouT 1 Reply Last reply
                                  0
                                  • Thank YouT Thank You

                                    I installed QT 5.15.2 and build with it. Got all dependencies with windeployqt and added libxml2-2.dll libxslt-1.dll.
                                    It now shows error zlib1__.dll not found.
                                    I searched in whole qt directory but couldn't find one so I managed to download zlib1.dll not zlib1__.dll from dll-files.com.
                                    I renamed zlib1.dll to zlib1__.dll and placed in binary directory. I don't know if this is good to do.
                                    Where is zlib1__.dll located in QT??? OR it isn't related with QT?

                                    Atleast it is working in 64bit version but shows TLS initialization failed Which is connected to OpenSSL so I am sure I will solve this problem.
                                    Edit:
                                    I copied libcrypto-3-x64.dll and libssl-3-x64.dll to executable directory but couldn't get it working
                                    Now some problems that I can't figure out are:
                                    It doesn't work with debug
                                    Most importantly it doesn't work with 32 bit which is most for me.
                                    How can I obtain it?

                                    Thank YouT Offline
                                    Thank YouT Offline
                                    Thank You
                                    wrote on last edited by Thank You
                                    #24

                                    @Thank-You
                                    Now after installing another version of openssl it is working on 64bit.
                                    I couldn't make it work in 32bit.
                                    And I found that many websites doesn't considered it as supported version.
                                    I found that we can embed existing application to QT application but has no idea.
                                    Main purpose of this is to run services like gmail , google docs and other servuces.
                                    Which would be good?
                                    I was just searching abt this yesterday and found about running application. Could you give links of working docs about this?

                                    I will create new question abt this

                                    https://forum.qt.io/topic/132721/opening-external-application-and-embed-it-without-opening-application-out-of-application

                                    Let's make QT free or It will go forever

                                    TRUE AND FALSE <3

                                    JKSHJ 1 Reply Last reply
                                    0
                                    • Thank YouT Thank You

                                      @Thank-You
                                      Now after installing another version of openssl it is working on 64bit.
                                      I couldn't make it work in 32bit.
                                      And I found that many websites doesn't considered it as supported version.
                                      I found that we can embed existing application to QT application but has no idea.
                                      Main purpose of this is to run services like gmail , google docs and other servuces.
                                      Which would be good?
                                      I was just searching abt this yesterday and found about running application. Could you give links of working docs about this?

                                      I will create new question abt this

                                      https://forum.qt.io/topic/132721/opening-external-application-and-embed-it-without-opening-application-out-of-application

                                      JKSHJ Offline
                                      JKSHJ Offline
                                      JKSH
                                      Moderators
                                      wrote on last edited by
                                      #25

                                      @Thank-You said in Using QWebkit for windows with mingw:

                                      And I found that many websites doesn't considered it as supported version.

                                      Web engines are very difficult to maintain because of security requirements. That is why the Qt Project replaced Qt WebKit (which was mostly maintained by the Qt folks) with Qt WebEngine (which is mostly maintained by the Chromium folks).

                                      @Konstantin-Tokarev has done a great job making Qt WebKit compatible with recent versions of Qt, but the last update was over 1 year ago. Lots of security vulnerabilities have been discovered in WebKit since then; that is why many websites don't consider it as a supported version.

                                      Main purpose of this is to run services like gmail , google docs and other servuces.
                                      Which would be good?

                                      Qt WebEngine for desktop platforms; Qt WebView for mobile platforms.

                                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                      1 Reply Last reply
                                      1

                                      • Login

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