Qt Forum

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

    Solved Inherit from web page result into run time error.

    Qt WebKit
    4
    18
    3220
    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.
    • B
      Bob Asm last edited by

      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 Reply Quote 0
      • K
        Konstantin Tokarev @Bob Asm last edited by

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

        B 1 Reply Last reply Reply Quote 0
        • K
          Konstantin Tokarev @Bob Asm last edited by

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

          B 1 Reply Last reply Reply Quote 0
          • B
            Bob Asm @Konstantin Tokarev last edited by

            @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 Reply Quote 0
            • B
              Bob Asm @Konstantin Tokarev last edited by

              @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 Reply Quote 0
              • K
                Konstantin Tokarev last edited by

                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 Reply Quote 0
                • B
                  Bob Asm last edited by

                  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 Reply Quote 0
                  • B
                    Bob Asm @Konstantin Tokarev last edited by

                    @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 Reply Quote 0
                    • B
                      Bob Asm @Bob Asm last edited by

                      @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 Reply Quote 0
                      • B
                        Bob Asm last edited by

                        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 Reply Quote 0
                        • K
                          Konstantin Tokarev last edited by

                          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 Reply Quote 0
                          • B
                            Bob Asm @Konstantin Tokarev last edited by

                            @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 Reply Quote 0
                            • K
                              Konstantin Tokarev last edited by

                              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 Reply Quote 0
                              • T
                                ThatDud3 last edited by ThatDud3

                                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 Reply Quote 0
                                • K
                                  Konstantin Tokarev last edited by

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

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    Bob Asm last edited by

                                    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 Reply Quote 0
                                    • Pablo J. Rogina
                                      Pablo J. Rogina last edited by

                                      @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 Reply Quote 0
                                      • B
                                        Bob Asm @Pablo J. Rogina last edited by

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

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