so, I need to parse some javascript against one html page (kinda a scripting for my app), but QWebPage throws SIGSEGV when I try to initialize it. It console application. Relevat parts of my code:
QT += core sql network xml webkit
QT -= gui
QMAKE_CXXFLAGS += -std=c++11
LIBS += -lqca
TARGET = jarvisd
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
QWebPage * p = new QWebPage();
p->mainFrame()->load(QUrl(url));
It crashes on the first line. From documentation for QWebPage, from "Using QWebPage in a Widget-less Environment" part, it seems this should be possible. But there is not error, just sigsegv :/
Thanks for your help.
QT += core widgets sql network xml webkit webkitwidgets
Use something like so:
etc.
Qt5 signals + lambda function used in the above code.
Edit: The above code runs in console mode on Windows 7. I replaced this snippet with the one in your post. That works too.
Edit 2: OK. I found the reason for the crash. Try replacing QCoreApplication with QApplication. And webkitwigets in the project file is required.