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. webenginewidgets on .pro of library produce error
Forum Updated to NodeBB v4.3 + New Features

webenginewidgets on .pro of library produce error

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwebengine
10 Posts 3 Posters 1.5k 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.
  • L Offline
    L Offline
    LovelyGrace
    wrote on 4 Feb 2019, 05:53 last edited by
    #1

    I have created a project using QWebEngine and would want to convert it as a library (Shared Library) so that it can be integrate to any project. To test it, I created a subdir project first, then a library which will use qwebengine and a console project that will manage the library to run.

    On .pro of the library and console project, I assume it is needed to include QT += core gui webenginewidgets, but I keep getting errors about qwebenginewidgets. I need qwebenginewidgets to be able to use qwebengine classes like QWebEngineView. How am I going to fix this?

    J 1 Reply Last reply 4 Feb 2019, 06:15
    0
    • L LovelyGrace
      4 Feb 2019, 05:53

      I have created a project using QWebEngine and would want to convert it as a library (Shared Library) so that it can be integrate to any project. To test it, I created a subdir project first, then a library which will use qwebengine and a console project that will manage the library to run.

      On .pro of the library and console project, I assume it is needed to include QT += core gui webenginewidgets, but I keep getting errors about qwebenginewidgets. I need qwebenginewidgets to be able to use qwebengine classes like QWebEngineView. How am I going to fix this?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 Feb 2019, 06:15 last edited by
      #2

      @LovelyGrace said in webenginewidgets on .pro of library produce error:

      but I keep getting errors about qwebenginewidgets

      when compiling your lib or the project using your lib?
      And what errors are those?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LovelyGrace
        wrote on 4 Feb 2019, 06:27 last edited by
        #3

        I am getting :-1: error: [sub-WebLogin-qmake_all] Error 3 or unknown: webenginewidgets, something like that.

        I wonder if it's because of the kit? does webenginewidgets only works at qt 5.9+ version?

        J 1 Reply Last reply 4 Feb 2019, 08:14
        0
        • L Offline
          L Offline
          LovelyGrace
          wrote on 4 Feb 2019, 06:53 last edited by
          #4

          And is it because of the msvc version?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 4 Feb 2019, 06:57 last edited by
            #5

            Hi,

            What version of Qt are you using ?
            What compiler are you using ?

            Yes, QtWebEngine has more drastic restrictions with regards to compilers because of Chromium that it uses internally. So depending on the Qt version you are currently using, you would need to have either MSVC2015 (pre-Qt 5.12) or MSVC2017 (starting with Qt5.12).

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LovelyGrace
              wrote on 4 Feb 2019, 07:04 last edited by
              #6

              I am using msvc 2015 and 2017 Qt 5.9.6 and it works as console project. Why isn't it working as library?

              How about mingw?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 4 Feb 2019, 07:06 last edited by
                #7

                It shouldn't make any difference.

                Can you show both the console and library .pro files ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LovelyGrace
                  wrote on 4 Feb 2019, 07:26 last edited by
                  #8

                  now i'm getting error from the subdir project C1083: Cannot open include file: 'QWebEngineView': No such file or directory when I tried to include QWebengine classes

                  This is the library.pro
                  QT += webenginewidgets
                  QT += webchannel websockets network
                  QT += core gui

                  CONFIG += c++11 console
                  CONFIG -= app_bundle

                  TARGET = WebLogin
                  TEMPLATE = lib

                  DEFINES += WEBLOGIN_LIBRARY
                  DEFINES += QT_DEPRECATED_WARNINGS

                  SOURCES +=
                  weblogin.cpp
                  Encryption/qblowfish.cpp
                  WebSocket/websocketclientwrapper.cpp
                  WebSocket/websockettransport.cpp

                  HEADERS +=
                  weblogin.h
                  weblogin_global.h \
                  Encryption/qblowfish.h
                  Encryption/qblowfish_p.h
                  WebSocket/websocketclientwrapper.h
                  WebSocket/websockettransport.h

                  unix {
                  target.path = /usr/lib
                  INSTALLS += target
                  }

                  and the console.pro
                  QT -= gui

                  CONFIG += c++11 console
                  CONFIG -= app_bundle

                  DEFINES += QT_DEPRECATED_WARNINGS

                  SOURCES +=
                  main.cpp

                  win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/release/ -lWebLogin
                  else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/debug/ -lWebLogin
                  else:unix: LIBS += -L$$OUT_PWD/../WebLogin/ -lWebLogin

                  INCLUDEPATH += $$PWD/../WebLogin
                  DEPENDPATH += $$PWD/../WebLogin

                  and the sub dir.pro
                  QT += webenginewidgets
                  QT += webchannel websockets network
                  QT += core gui

                  TEMPLATE = subdirs

                  SUBDIRS +=
                  WebLogin
                  ManageLogin

                  When I tried to build the library only, it doesn;t produce the error, but when I am trying to build the whole project from sub dir project including the library and the console, it produce the error

                  I am only using kit msvc 2015 and 2017 Qt 5.9.6

                  J 1 Reply Last reply 4 Feb 2019, 08:16
                  0
                  • L LovelyGrace
                    4 Feb 2019, 06:27

                    I am getting :-1: error: [sub-WebLogin-qmake_all] Error 3 or unknown: webenginewidgets, something like that.

                    I wonder if it's because of the kit? does webenginewidgets only works at qt 5.9+ version?

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 4 Feb 2019, 08:14 last edited by
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • L LovelyGrace
                      4 Feb 2019, 07:26

                      now i'm getting error from the subdir project C1083: Cannot open include file: 'QWebEngineView': No such file or directory when I tried to include QWebengine classes

                      This is the library.pro
                      QT += webenginewidgets
                      QT += webchannel websockets network
                      QT += core gui

                      CONFIG += c++11 console
                      CONFIG -= app_bundle

                      TARGET = WebLogin
                      TEMPLATE = lib

                      DEFINES += WEBLOGIN_LIBRARY
                      DEFINES += QT_DEPRECATED_WARNINGS

                      SOURCES +=
                      weblogin.cpp
                      Encryption/qblowfish.cpp
                      WebSocket/websocketclientwrapper.cpp
                      WebSocket/websockettransport.cpp

                      HEADERS +=
                      weblogin.h
                      weblogin_global.h \
                      Encryption/qblowfish.h
                      Encryption/qblowfish_p.h
                      WebSocket/websocketclientwrapper.h
                      WebSocket/websockettransport.h

                      unix {
                      target.path = /usr/lib
                      INSTALLS += target
                      }

                      and the console.pro
                      QT -= gui

                      CONFIG += c++11 console
                      CONFIG -= app_bundle

                      DEFINES += QT_DEPRECATED_WARNINGS

                      SOURCES +=
                      main.cpp

                      win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/release/ -lWebLogin
                      else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/debug/ -lWebLogin
                      else:unix: LIBS += -L$$OUT_PWD/../WebLogin/ -lWebLogin

                      INCLUDEPATH += $$PWD/../WebLogin
                      DEPENDPATH += $$PWD/../WebLogin

                      and the sub dir.pro
                      QT += webenginewidgets
                      QT += webchannel websockets network
                      QT += core gui

                      TEMPLATE = subdirs

                      SUBDIRS +=
                      WebLogin
                      ManageLogin

                      When I tried to build the library only, it doesn;t produce the error, but when I am trying to build the whole project from sub dir project including the library and the console, it produce the error

                      I am only using kit msvc 2015 and 2017 Qt 5.9.6

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 4 Feb 2019, 08:16 last edited by
                      #10

                      @LovelyGrace said in webenginewidgets on .pro of library produce error:

                      but when I am trying to build the whole project from sub dir project including the library and the console, it produce the error

                      You need to add Qt += webenginewidgets to your console project as well.

                      1 Reply Last reply
                      0

                      1/10

                      4 Feb 2019, 05:53

                      • Login

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