2

I have a very basic program with a web enginve view.

Here's the main.cpp:

#include "MainWindow.h"
#include <QApplication>
#include <qtwebengineglobal.h>

int main(int argc, char *argv[])
{
    try
    {
    QApplication a(argc, argv);

    QtWebEngine::initialize();


    MainWindow w;
    w.show();

    return a.exec();
    }
    catch(...)
    {}
}

And here is the part creating the web view:

#include "MainWindow.h"
#include "ui_MainWindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QWebEngineView *view = new QWebEngineView();
    view->load(QUrl("http://google.com/"));
    view->show();
    ui->verticalLayout_2->addWidget(view);
}

MainWindow::~MainWindow()
{
    delete ui;
}

When it starts, it prints out the following:

QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
[0901/102938:ERROR:scoped_ole_initializer.cc(20)] Multiple OleInitialize() calls for thread 4988

And upon exit it crashes:

1                                                                                 0xfffffffffeeefeee 
2  glGetColorTableParameterivEXT                   opengl32sw                     0x41f9276          
3  glGetColorTableParameterivEXT                   opengl32sw                     0x418b966          
4  glGetColorTableParameterivEXT                   opengl32sw                     0x41b0dd1          
5  glGetColorTableParameterivEXT                   opengl32sw                     0x417397a          
6  glGetColorTableParameterivEXT                   opengl32sw                     0x41854ba          
7  DrvDeleteContext                                opengl32sw                     0x41530ef          
8  QWindowsGLContext::~QWindowsGLContext           qwindowsglcontext.cpp     1180 0x297a411          
9  QWindowsGLContext::`scalar deleting destructor' qwindowsd                      0x297f53f          
10 QOpenGLContext::destroy                         qopenglcontext.cpp        653  0xc3771b           
11 QOpenGLContext::~QOpenGLContext                 qopenglcontext.cpp        694  0xc366a8           
12 QOpenGLContext::`scalar deleting destructor'    Qt5WebEngineCored              0x10151ed0         
13 QtWebEngineCore::deleteShareContext             qtwebenginecoreglobal.cpp 57   0x10151d29         
14 qt_call_post_routines                           qcoreapplication.cpp      299  0x670fed06         
15 QApplication::~QApplication                     qapplication.cpp          833  0x642127b6         
16 main                                            main.cpp                  17   0x751b8            
17 WinMain                                         qtmain_win.cpp            123  0x7823d            
18 invoke_main                                     exe_common.inl            99   0x7654e            
19 __scrt_common_main_seh                          exe_common.inl            253  0x763b0            
20 __scrt_common_main                              exe_common.inl            296  0x7624d            
21 WinMainCRTStartup                               exe_winmain.cpp           17   0x76568            
22 BaseThreadInitThunk                             kernel32                       0x758eef1c         
23 __RtlUserThreadStart                            ntdll                          0x77143648         
24 _RtlUserThreadStart                             ntdll                          0x7714361b         

Has anyone ever seen this behaviour, and is there a solution for it?

OS: Windows, QT: 5.7, C++: VS 2015

3
  • 1
    Although it's not the source of your problem, you should never use any Qt includes that aren't formatted like <QSomething> or <QtModule>. Specifically <QtModule/QSomething> is wrong, as is <qsomething.h>. You want to include <QtWebEngineWidgets>. Sep 1, 2016 at 13:49
  • 1
    Furthermore, wrapping the contents of main in a try-catch block is pointless: Qt doesn't use exceptions, and it won't let any escape exec() nor any of the constructors you invoke. Sep 1, 2016 at 13:50
  • The obvious problem is that ANGLE fails to start. Are you running the application from Qt Creator? Where did your Qt come from? Are you sure that your installation of Qt includes in its bin folder everything ANGLE needs to run, e.g. d3dcompiler_4x.dll? Sep 1, 2016 at 13:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.