Inherit from web page result into run time error.
-
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.
-
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.
What happens if you replace
webPage page
toQWebPage page
? Is this a complete application code? -
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.
Also, what Qt and QtWebit versions are you using and how did you install them?
-
What happens if you replace
webPage page
toQWebPage page
? Is this a complete application code?@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.
-
Also, what Qt and QtWebit versions are you using and how did you install them?
@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
-
Please try with Qt 5.9 and MinGW 5.3 binaries from https://github.com/annulen/webkit/releases/tag/qtwebkit-5.212.0-alpha2
-
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?
-
Please try with Qt 5.9 and MinGW 5.3 binaries from https://github.com/annulen/webkit/releases/tag/qtwebkit-5.212.0-alpha2
@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
-
@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
@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.
-
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).
-
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)
-
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)
@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, -
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
-
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-installerP.S. some say online installer is not affected...
HTH -
Topic is about MinGW, cdb has nothing to do with it
-
@Bob-Asm please don't forget to mark your post as solved. Thanks
-
@Bob-Asm please don't forget to mark your post as solved. Thanks
@Pablo-J.-Rogina I'm sorry, I new to this forum. Done. Thank you.