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} Problems with QWebView

[SOLVED} Problems with QWebView

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 5.2k 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.
  • P Offline
    P Offline
    Paawan
    wrote on last edited by
    #1

    Hi All,

    I have derived a class from QWidget. Named it WebBrowser.

    I then included QWebView class in the WebBrowser class.

    When I try to make a QWebView object I am getting all sorts of problems.

    This is what I did like any other object:

    In the WebBrowser header file:

    QWebView * browser;

    In the WebBrowser CPP file:

    browser = new QWebView;

    I am getting

    webbrowser.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QWebView::QWebView(class QWidget *)" (_imp??0QWebView@@QEAA@PEAVQWidget@@@Z) referenced in function "public: void __cdecl WebBrowser::loadPage(void)" (?loadPage@WebBrowser@@QEAAXXZ)

    webbrowser.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QWebView::~QWebView(void)" (_imp??1QWebView@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QWebView::`scalar deleting destructor'(unsigned int)" (??_GQWebView@@UEAAPEAXI@Z)

    About 18 more errors like this.

    Please help.

    Thanks

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

      Hi,

      Did you add

      @QT += webkit@

      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
      0
      • P Offline
        P Offline
        Paawan
        wrote on last edited by
        #3

        Hi,

        I now added. But still get give error messages. First one below:

        webbrowser.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QWebView::QWebView(class QWidget *)" (_imp??0QWebView@@QEAA@PEAVQWidget@@@Z) referenced in function "public: void __cdecl WebBrowser::loadPage(void)" (?loadPage@WebBrowser@@QEAAXXZ)

        second one:

        webbrowser.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QWebView::~QWebView(void)" (_imp??1QWebView@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QWebView::`scalar deleting destructor'(unsigned int)" (??_GQWebView@@UEAAPEAXI@Z)

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kevina67
          wrote on last edited by
          #4

          Try to add

          @QT += webkitwidgets@

          to your pro file

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Paawan
            wrote on last edited by
            #5

            I did try. It did not work.

            How do I check if I have the webkit libraries in my installation?

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

              Then which version of Qt are you using on which OS and how did you install it ?

              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
              • P Offline
                P Offline
                Paawan
                wrote on last edited by
                #7

                Hi,

                The OS is Windows 8 Pro

                Qt Creator 2.7.0

                Qt 5.0.2 (32 bit)

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  NicuPopescu
                  wrote on last edited by
                  #8

                  Have you tried to compile/run the demos\browser example?

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Paawan
                    wrote on last edited by
                    #9

                    Hi,

                    When I try to compile the application without adding QT +=webkitwidgets, the applications does not compile.

                    When I later add QT +=webkitwidgets it still does not compile.

                    But when I make a new project and before compiling add QT +=webkitwidgets everything works fine.

                    Not sure why it does like that but I can make progress.

                    Thank you all for your time.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      masum
                      wrote on last edited by
                      #10

                      One more thing when you are adding @QT += webkitwidgets@ if there have already @QT+= deceleration@ then just add webkitwidgets after existing line. Do not replace existing line.

                      Kind Regards

                      Md. Rashidul Hasan
                      Software Architect
                      OnnoRokom Software Ltd.
                      Cell: 8801836885252

                      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