Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Access violation in QQuickWebEngineViewPrivate::initializeProfile()
Qt 6.11 is out! See what's new in the release blog

Access violation in QQuickWebEngineViewPrivate::initializeProfile()

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 523 Views 1 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.
  • M Offline
    M Offline
    maba
    wrote on last edited by
    #1

    I'm working on a project using Qt 5.12.8 to embed the WebEngineView. If I embed the WebEngineView in a simple qml file and run only test part 1 things are working fine. However, if I run both test part 1 & test part 2 in sequence I get an access violation in QQuickWebEngineViewPrivate::initializeProfile().

    Test case using gtest framework

    TEST( QuickControlsLoadTest, DialogWebViewRaw )
    {
    	QUrl dirOfControls( "qml/DialogWebViewRaw.qml" );
    
    	{
                    // Test part 1
    		QCoreApplication::setOrganizationName( "Example" );
    		QApplication::setAttribute( Qt::AA_ShareOpenGLContexts ); // For WebView needed
    		QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
    		int          m_argc( 1 );
    		char*        m_argv[1];
    		m_argv[0] = "";
    		QApplication app( m_argc, m_argv );
    
    		QtWebEngine::initialize();
    
    		QQmlApplicationEngine appEngine;
    		appEngine.load( dirOfControls );
    		//app.exec();
    	}
    	{
                    // Test part 2
    		QCoreApplication::setOrganizationName( "Example" );
    		QApplication::setAttribute( Qt::AA_ShareOpenGLContexts ); // For WebView needed
    		QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
    		int          m_argc( 1 );
    		char*        m_argv[1];
    		m_argv[0] = "";
    		QApplication app( m_argc, m_argv );
    
    		QtWebEngine::initialize();
    
    		QQmlApplicationEngine appEngine;
    		appEngine.load( dirOfControls );
    		//app.exec();
    	}
    }
    

    DialogWebViewRaw.qml contains the following code

    import QtQuick 2.11
    import QtQuick.Window 2.2
    import QtQuick.Controls 2.4
    import QtQuick.Layouts 1.11
    import QtWebEngine 1.1
    
    ApplicationWindow {
    	id: window
    	title: "Web View"
    
    	ColumnLayout {
    
    		WebEngineView {
    			id: webView
    			//url: 'https://www.google.com/'
    			Layout.fillHeight: true
    			Layout.fillWidth: true
    		}
    	}
    }
    
    

    Call stack of access violation

    Qt5WebEngined.dll!QQuickWebEngineViewPrivate::initializeProfile() Line 181	C++
    Qt5WebEngined.dll!QQuickWebEngineView::componentComplete() Line 2092	C++
    Qt5Qmld.dll!QQmlObjectCreator::finalize(QQmlInstantiationInterrupt & interrupt) Line 1375	C++
    Qt5Qmld.dll!QQmlComponentPrivate::complete(QQmlEnginePrivate * enginePriv, QQmlComponentPrivate::ConstructionState * state) Line 937	C++
    Qt5Qmld.dll!QQmlComponentPrivate::completeCreate() Line 972	C++
    Qt5Qmld.dll!QQmlComponent::completeCreate() Line 964	C++
    Qt5Qmld.dll!QQmlComponent::create(QQmlContext * context) Line 798	C++
    Qt5Qmld.dll!QQmlApplicationEnginePrivate::finishLoad(QQmlComponent * c) Line 136	C++
    Qt5Qmld.dll!QQmlApplicationEnginePrivate::startLoad(const QUrl & url, const QByteArray & data, bool dataFlag) Line 121	C++
    Qt5Qmld.dll!QQmlApplicationEngine::load(const QUrl & url) Line 266	C++
    QuickTests.exe!QuickControlsLoadTest_DialogWebViewRaw_Test::TestBody() Line 98	C++
    
    

    Why I get this access violation? Is the WebEngineProfile deleted after execution of part 1 of test case above?
    I know the test doesn't makes much sense at all but I wonder why I get the error.

    I appreciate any help.

    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