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. Inherit from web page result into run time error.
Forum Updated to NodeBB v4.3 + New Features

Inherit from web page result into run time error.

Scheduled Pinned Locked Moved Solved Qt WebKit
18 Posts 4 Posters 4.3k Views 2 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.
  • B Offline
    B Offline
    Bob Asm
    wrote on last edited by
    #1

    I have na odd reason that I'm trying to figure out has been few days.

    I have a Qt(QObject) class that, when declared, crash the application either right after initilization or few seconds after GUI show up.
    The class is exactly this:

    webPage.h

    class webPage : public QWebPage
    {
        Q_OBJECT
    
    public:
        webPage(QObject *parent = 0);
        ~webPage();
    };
    

    webPage.cpp

    webPage::webPage(QObject *parent)
        : QWebPage(parent)
    {
        qDebug() << "webPage::webPage() got called!";
    }
    
    webPage::~webPage()
    {
    }
    

    And my mainwindow.h class:

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
        void closeEvent(QCloseEvent *e);
    private slots:
        void on_pushButton_2_clicked();
    
        void on_pushButton_3_clicked();
    public:
        Ui::MainWindow *ui;
        browserControl webControl;
        webPage page; // <-- unless I remove this, the application crashs.
    };
    

    The constructor is like this:

    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        //webControl.setPage(&page);
    }
    

    Can someone help me to point out the error reason? it isn't even SEGFAULT or something, start in debug mode doesn't helps, the application crashs/frooze.

    K 2 Replies Last reply
    0
    • B Bob Asm

      I have na odd reason that I'm trying to figure out has been few days.

      I have a Qt(QObject) class that, when declared, crash the application either right after initilization or few seconds after GUI show up.
      The class is exactly this:

      webPage.h

      class webPage : public QWebPage
      {
          Q_OBJECT
      
      public:
          webPage(QObject *parent = 0);
          ~webPage();
      };
      

      webPage.cpp

      webPage::webPage(QObject *parent)
          : QWebPage(parent)
      {
          qDebug() << "webPage::webPage() got called!";
      }
      
      webPage::~webPage()
      {
      }
      

      And my mainwindow.h class:

      namespace Ui {
      class MainWindow;
      }

      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          explicit MainWindow(QWidget *parent = 0);
          ~MainWindow();
          void closeEvent(QCloseEvent *e);
      private slots:
          void on_pushButton_2_clicked();
      
          void on_pushButton_3_clicked();
      public:
          Ui::MainWindow *ui;
          browserControl webControl;
          webPage page; // <-- unless I remove this, the application crashs.
      };
      

      The constructor is like this:

      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent),
          ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          //webControl.setPage(&page);
      }
      

      Can someone help me to point out the error reason? it isn't even SEGFAULT or something, start in debug mode doesn't helps, the application crashs/frooze.

      K Offline
      K Offline
      Konstantin Tokarev
      wrote on last edited by
      #2

      What happens if you replace webPage page to QWebPage page? Is this a complete application code?

      B 1 Reply Last reply
      0
      • B Bob Asm

        I have na odd reason that I'm trying to figure out has been few days.

        I have a Qt(QObject) class that, when declared, crash the application either right after initilization or few seconds after GUI show up.
        The class is exactly this:

        webPage.h

        class webPage : public QWebPage
        {
            Q_OBJECT
        
        public:
            webPage(QObject *parent = 0);
            ~webPage();
        };
        

        webPage.cpp

        webPage::webPage(QObject *parent)
            : QWebPage(parent)
        {
            qDebug() << "webPage::webPage() got called!";
        }
        
        webPage::~webPage()
        {
        }
        

        And my mainwindow.h class:

        namespace Ui {
        class MainWindow;
        }

        class MainWindow : public QMainWindow
        {
            Q_OBJECT
        
        public:
            explicit MainWindow(QWidget *parent = 0);
            ~MainWindow();
            void closeEvent(QCloseEvent *e);
        private slots:
            void on_pushButton_2_clicked();
        
            void on_pushButton_3_clicked();
        public:
            Ui::MainWindow *ui;
            browserControl webControl;
            webPage page; // <-- unless I remove this, the application crashs.
        };
        

        The constructor is like this:

        MainWindow::MainWindow(QWidget *parent) :
            QMainWindow(parent),
            ui(new Ui::MainWindow)
        {
            ui->setupUi(this);
            //webControl.setPage(&page);
        }
        

        Can someone help me to point out the error reason? it isn't even SEGFAULT or something, start in debug mode doesn't helps, the application crashs/frooze.

        K Offline
        K Offline
        Konstantin Tokarev
        wrote on last edited by
        #3

        Also, what Qt and QtWebit versions are you using and how did you install them?

        B 1 Reply Last reply
        0
        • K Konstantin Tokarev

          What happens if you replace webPage page to QWebPage page? Is this a complete application code?

          B Offline
          B Offline
          Bob Asm
          wrote on last edited by
          #4

          @Konstantin-Tokarev Same issue.

          This is the Qt I'm using: https://imgur.com/zA6iCSA

          odd is, I have another Project that uses same thing but does compile fine. I can't figure out why. Yes, this is all my code.

          1 Reply Last reply
          0
          • K Konstantin Tokarev

            Also, what Qt and QtWebit versions are you using and how did you install them?

            B Offline
            B Offline
            Bob Asm
            wrote on last edited by
            #5

            @Konstantin-Tokarev I downloaded Qt from oficial open source repositories, I haven't the name but the setup is qt-opensource-windows-x86-mingw492-5.5.0.exe

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Konstantin Tokarev
              wrote on last edited by
              #6

              Please try with Qt 5.9 and MinGW 5.3 binaries from https://github.com/annulen/webkit/releases/tag/qtwebkit-5.212.0-alpha2

              B 1 Reply Last reply
              0
              • B Offline
                B Offline
                Bob Asm
                wrote on last edited by
                #7

                This is the most recente Qt version with mingw that I could find:

                https://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-windows-x86-mingw530-5.8.0.exe

                You mean this one? How do I install QWebView from this binaries?

                1 Reply Last reply
                0
                • K Konstantin Tokarev

                  Please try with Qt 5.9 and MinGW 5.3 binaries from https://github.com/annulen/webkit/releases/tag/qtwebkit-5.212.0-alpha2

                  B Offline
                  B Offline
                  Bob Asm
                  wrote on last edited by
                  #8

                  @Konstantin-Tokarev I followed the steps here:

                  https://github.com/therecipe/qt/wiki/Installing-QtWebKit-Module

                  But when I went to compile, I get this error:

                  C:/Qt/Qt5.8.0/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5WebKitWidgetsd
                  C:/Qt/Qt5.8.0/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5WebKitd
                  collect2.exe: error: ld returned 1 exit status
                  
                  B 1 Reply Last reply
                  0
                  • B Bob Asm

                    @Konstantin-Tokarev I followed the steps here:

                    https://github.com/therecipe/qt/wiki/Installing-QtWebKit-Module

                    But when I went to compile, I get this error:

                    C:/Qt/Qt5.8.0/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5WebKitWidgetsd
                    C:/Qt/Qt5.8.0/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5WebKitd
                    collect2.exe: error: ld returned 1 exit status
                    
                    B Offline
                    B Offline
                    Bob Asm
                    wrote on last edited by
                    #9

                    @Bob-Asm solve that issue. I did remember that Webkit only build on release soon as I see it was looking for a debug library -lQt5WebKitWidgetsd switch to release and solved that issue. The current one is:

                    C:\Qt\Qt5.8.0\5.8\mingw53_32\bin\Qt5WebKit.dll does not exist.
                    
                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      Bob Asm
                      wrote on last edited by
                      #10

                      okay, after a while I managed to make it work with Qt 5.8: download the Webkit, extracted to proper folder, renamed few dlls (had lib prefix) get webkit*.exe somewhere else and copied to mingw\bin folder then it compiled. I run once without any crash. To make sure it was ok, I closed and opened Qt again, compiled, then it frooze in the same way as the previous Qt version I was using. I'm clueless what's happeing, worse, I can't run in debug mode due lack of debug symbols on qtwebkit (as far I know, it's release and only works so).

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        Konstantin Tokarev
                        wrote on last edited by
                        #11

                        You cannot use Qt 5.8 with these binaries.

                        For building in debug configuration please use http://download.qt.io/snapshots/ci/qtwebkit/5.212/1516463897/qtwebkit/qtwebkit-Windows-Windows_7-Mingw53-Windows-Windows_7-X86.7z and Qt 5.10.0 (install from online repo with MaintenanceTool)

                        B 1 Reply Last reply
                        0
                        • K Konstantin Tokarev

                          You cannot use Qt 5.8 with these binaries.

                          For building in debug configuration please use http://download.qt.io/snapshots/ci/qtwebkit/5.212/1516463897/qtwebkit/qtwebkit-Windows-Windows_7-Mingw53-Windows-Windows_7-X86.7z and Qt 5.10.0 (install from online repo with MaintenanceTool)

                          B Offline
                          B Offline
                          Bob Asm
                          wrote on last edited by
                          #12

                          @Konstantin-Tokarev I didn't find Qt 5.10.0 with mingw so I'm using Qt 5.8.0. Can I add webkit using MaintenanceTool? if so, how do I do that?
                          as you can see, I'm pretty newbit to Qt. I'll try those binaries if I fail to add webkit to Qt 5.8,

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            Konstantin Tokarev
                            wrote on last edited by
                            #13

                            You can install Qt 5.10 for mingw using normal windows installer, or install it from online repository using MaintenanceTool which is included with the Qt version that you already have

                            For QtWebKit, you still need to download archive and unpack it into Qt manually. Installer component is not yet there

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              ThatDud3
                              wrote on last edited by ThatDud3
                              #14

                              Be aware that in Qt 5.10.0 Offline Installer qt-creator comes without debugger support on Windows
                              see https://forum.qt.io/topic/85986/qtcreatorcdbext-dll-cannot-be-found-qt-5-10-0-offline-installer

                              P.S. some say online installer is not affected...
                              HTH

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                Konstantin Tokarev
                                wrote on last edited by
                                #15

                                Topic is about MinGW, cdb has nothing to do with it

                                1 Reply Last reply
                                0
                                • B Offline
                                  B Offline
                                  Bob Asm
                                  wrote on last edited by
                                  #16

                                  Here's I solved that: removed my internet banking software. It somehow was preventing webkit within my Qt application to work. Thank you all guys for help.

                                  1 Reply Last reply
                                  0
                                  • Pablo J. RoginaP Offline
                                    Pablo J. RoginaP Offline
                                    Pablo J. Rogina
                                    wrote on last edited by
                                    #17

                                    @Bob-Asm please don't forget to mark your post as solved. Thanks

                                    Upvote the answer(s) that helped you solve the issue
                                    Use "Topic Tools" button to mark your post as Solved
                                    Add screenshots via postimage.org
                                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                    B 1 Reply Last reply
                                    0
                                    • Pablo J. RoginaP Pablo J. Rogina

                                      @Bob-Asm please don't forget to mark your post as solved. Thanks

                                      B Offline
                                      B Offline
                                      Bob Asm
                                      wrote on last edited by
                                      #18

                                      @Pablo-J.-Rogina I'm sorry, I new to this forum. Done. Thank you.

                                      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