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. QtWebEngine: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

QtWebEngine: No such file or directory

Scheduled Pinned Locked Moved Solved QtWebEngine
4 Posts 3 Posters 5.0k Views 2 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.
  • P Offline
    P Offline
    pderocco
    wrote on last edited by
    #1

    Neither the forum search nor Google turned up anything on this.

    I'm trying to use QtWebEngine in a QML program, all the latest versions, Windows 7, MSVC-2017 compiler. I checked the WebEngine item when I installed Qt Creator. Here's what I've done in my code:

    • Added webengine to the QT variable in the project file.
    • Added import QtWebEngine 1.7 to the QML file.
    • Added #include <QtWebEngine> to the main.cpp file.
    • Added QtWebEngine::initialize(); to the main function, after creating the app.

    I get C1083: Cannot open include file: 'QtWebEngine': No such file or directory.

    All of the above was per the instructions in the current QtWebEngine documentation. Then I tried the example WebEngine Quick Nano Browser, and it works fine.

    So what's the difference? It uses an earlier version of QtWebEngine, but I'm not getting far enough for that to matter. I found that its main.cpp says #include <QtWebEngine/qtwebengineglobal.h>. So I changed my application to include that. Now it compiles, but I get a link error on the QtWebEngine::initialize() function.

    But I still can't see any explanation why the quicknanobrowser project should find the initialize function but my project doesn't. Any ideas?

    aha_1980A 1 Reply Last reply
    0
    • P pderocco

      Neither the forum search nor Google turned up anything on this.

      I'm trying to use QtWebEngine in a QML program, all the latest versions, Windows 7, MSVC-2017 compiler. I checked the WebEngine item when I installed Qt Creator. Here's what I've done in my code:

      • Added webengine to the QT variable in the project file.
      • Added import QtWebEngine 1.7 to the QML file.
      • Added #include <QtWebEngine> to the main.cpp file.
      • Added QtWebEngine::initialize(); to the main function, after creating the app.

      I get C1083: Cannot open include file: 'QtWebEngine': No such file or directory.

      All of the above was per the instructions in the current QtWebEngine documentation. Then I tried the example WebEngine Quick Nano Browser, and it works fine.

      So what's the difference? It uses an earlier version of QtWebEngine, but I'm not getting far enough for that to matter. I found that its main.cpp says #include <QtWebEngine/qtwebengineglobal.h>. So I changed my application to include that. Now it compiles, but I get a link error on the QtWebEngine::initialize() function.

      But I still can't see any explanation why the quicknanobrowser project should find the initialize function but my project doesn't. Any ideas?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @pderocco have you re-run qmake after your .pro file changes? In QtCreator Build > Run Qmake. Afterwards I'd do a full rebuild (Build > Rebuild all)

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        pderocco
        wrote on last edited by
        #3

        Yes, that seemed to work. The build system doesn't seem to be very good at knowing what depends on what.

        mrjjM 1 Reply Last reply
        0
        • P pderocco

          Yes, that seemed to work. The build system doesn't seem to be very good at knowing what depends on what.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @pderocco
          Hi
          Its more about qmake having a cache to avoid re parsing whole of .pro file. It does detect changes (like adding a file ) but
          other changes requires a manual update.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved