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
Qt 6.11 is out! See what's new in the release blog

Using QWebkit for windows with mingw

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 5 Posters 9.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.
  • JKSHJ JKSH

    @Thank-You See if you can use one of the pre-built snapshots of the community version of Qt WebKit: https://download.qt.io/snapshots/ci/qtwebkit/5.212/latest/qtwebkit/

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

    @JKSH I used these precompiled libraries as said in mentioned links. (https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-build)

    I tried download it's repo but couldn't as it shows errors after some time of fetching

    Let's make QT free or It will go forever

    TRUE AND FALSE <3

    artwawA 1 Reply Last reply
    0
    • Thank YouT Thank You

      @JKSH I used these precompiled libraries as said in mentioned links. (https://forum.qt.io/topic/119469/webkit-for-mingw-how-to-build)

      I tried download it's repo but couldn't as it shows errors after some time of fetching

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

      @Thank-You when using precompiled ones you don't need to build them, right? That's the whole point. Just grab the binaries, include, go.

      For more information please re-read.

      Kind Regards,
      Artur

      Thank YouT 1 Reply Last reply
      0
      • artwawA artwaw

        @Thank-You when using precompiled ones you don't need to build them, right? That's the whole point. Just grab the binaries, include, go.

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

        @artwaw
        Yes sir, I did that. Above mentioned errors are produced by using precompiled binaries

        That method din't work so I was thinking of building but couldn't clone the repo.

        Are there other options with QT with mingw and windows. I don't need any support for linux

        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
          Yes sir, I did that. Above mentioned errors are produced by using precompiled binaries

          That method din't work so I was thinking of building but couldn't clone the repo.

          Are there other options with QT with mingw and windows. I don't need any support for linux

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

          @Thank-You How did you install those precompiled binaries? Can you show your .pro file? It looks like those are not placed correctly, hence the fail.

          For more information please re-read.

          Kind Regards,
          Artur

          Thank YouT 1 Reply Last reply
          0
          • artwawA artwaw

            @Thank-You How did you install those precompiled binaries? Can you show your .pro file? It looks like those are not placed correctly, hence the fail.

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

            @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 😂😂😂

            Let's make QT free or It will go forever

            TRUE AND FALSE <3

            artwawA 2 Replies 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
              #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

                                          • Login

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