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. ‘QWebView’ does not name a type

‘QWebView’ does not name a type

Scheduled Pinned Locked Moved General and Desktop
qwebview
7 Posts 3 Posters 4.1k 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.
  • _ Offline
    _ Offline
    ___Jan___
    wrote on last edited by
    #1

    Hello

    I get error

     error: ‘QWebView’ does not name a type
    

    although I have

    #include <QtWebView/QtWebView>
    

    what does not work:

    #include<QWebView>
    

    Ubuntu 14.04 OS

    I use QT5 with VTK 6 if this is needed.

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If you are thinking about the QtWebView module, did you add:

      QT += webview

      to your pro file ?

      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
      1
      • SGaistS SGaist

        Hi,

        If you are thinking about the QtWebView module, did you add:

        QT += webview

        to your pro file ?

        _ Offline
        _ Offline
        ___Jan___
        wrote on last edited by
        #3

        @SGaist

        Hello

        forgot to mention it is a CMakeProject.

        find_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKit)
        

        is included. Not sure if WebKit is the right module name, tried to look this up.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          So your are using the QWebView from webkit, IIRC, you would also need the webkitwidgets module

          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
          • _ ___Jan___

            Hello

            I get error

             error: ‘QWebView’ does not name a type
            

            although I have

            #include <QtWebView/QtWebView>
            

            what does not work:

            #include<QWebView>
            

            Ubuntu 14.04 OS

            I use QT5 with VTK 6 if this is needed.

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by JKSH
            #5

            Hi @Jan,

            It is confusing, but "QWebView" does not come from "Qt WebView". Instead, it comes from "Qt WebKit Widgets", like @SGaist said.

            Qt WebView is mainly for mobile platforms to use the native web engine.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • _ Offline
              _ Offline
              ___Jan___
              wrote on last edited by
              #6

              Thanks for the help, I will test out (right now I do not have this setup anymore). Just one more quick question:
              the module name is WebKitWidgets? So

              find_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
              

              will work?
              and then in the include:

              #include <QtWebKitWidgets>
              

              Thanks alot

              JKSHJ 1 Reply Last reply
              0
              • _ ___Jan___

                Thanks for the help, I will test out (right now I do not have this setup anymore). Just one more quick question:
                the module name is WebKitWidgets? So

                find_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
                

                will work?
                and then in the include:

                #include <QtWebKitWidgets>
                

                Thanks alot

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @Jan said:

                the module name is WebKitWidgets? So

                find_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
                

                will work?

                I'm not sure, sorry. I don't use CMake.

                and then in the include:

                #include <QtWebKitWidgets>
                

                No need to include the whole module. Just include the class you want: #include <QWebView>

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                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