Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QWebSettings::setAttribute crash
Forum Update on Monday, May 27th 2025

[Solved] QWebSettings::setAttribute crash

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views
  • 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.
  • Z Offline
    Z Offline
    zlxwd
    wrote on last edited by
    #1

    Program crashes when execute QWebSettings::setAttribute() function.

    Qt5.3, Windows 7, Visual Studio 2013

    [code]
    #include "qwebview.h"
    #include <Windows.h>

    int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT) {
    QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
    return 0;
    }
    [/code]

    Unhandled exception at 0x000007FEDB347E99 (Qt5Gui.dll) in Qt.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

    Any idea about the crash?


    Fixed

    I'm not sure if it's the common case.

    I add both the debug and release lib files to Visual Studio(Project property -> Linker -> Input -> Additional Dependencies), which lead to this strange problem. But there is no warning/error in the link stage...

    Remove each kind of lib files will fix the issue.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      QWebSettings::globalSettings() is definitely returning null. What is the context of using directly like this ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        Need your favour. How did you solve this ? Can post the answer ? It will help community.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        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