Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. How to compile qtwebkit-plugins?

How to compile qtwebkit-plugins?

Scheduled Pinned Locked Moved Qt WebKit
spellcheckqwebviewqtwebkitwindowsmingw
15 Posts 2 Posters 6.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.
  • B Offline
    B Offline
    brcontainer
    wrote on 6 Mar 2015, 18:48 last edited by A Former User
    #1

    QtWebkit-plugins is a library that provides features to the QWebView eg SpellCheck and Notification Web API.

    Read about:

    • SpellCheck

    • Notification Web API

    I tried to compile the code in Windows, but my QWebView not working as expected, in other words SpellCheck and Notification Web API not working. It's like I've been not-using "QtWebkitplugins". Which can be?

    In the documentation that says to compile I have to run:

    $ qmake
    $ make && make install
    

    Read more in QtWebkit-plugins repository

    But I read on another issue (here in StackOverflow) that when I use the MingW I do not need to use qmake, so I tried to do the step-by-step to compile:

    • I compiled hunspell
    • Copied hunspell for C:\Qt5.4.0\5.4\mingw491_32\bin and C:\Qt5.4.0\5.4\mingw491_32\lib
    • Compiled the qtwebkit-plugins.pro project (clicked in Build on QtCreator)
    • Build generate libqtwebkitpluginsd.a and qtwebkitplugins.dll
    • Copied libqtwebkitpluginsd.a for C:\Qt5.4.0\5.4\mingw491_32\lib
    • Copied qtwebkitplugins.dll for C:\Qt5.4.0\5.4\mingw491_32\plugins\webkit and C:\Qt5.4.0\5.4\mingw491_32\bin

    After that I compiled another simple project that uses QWebView then tested the SpellCheck in a <textarea spellcheck="true"></textarea> and did not work.

    I tested the Notification Web API and also did not work.

    How do my projects work these features?

    QT project: https://github.com/brcontainer/qt-helper

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Mar 2015, 22:24 last edited by
      #2

      Hi,

      You should run your application with the QT_DEBUG_PUGINS environment variable set to 1 to see if the plugins are found and if they encounter a problem loading. You can do that in the run part of the Project panel

      Hope it helps

      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
      • B Offline
        B Offline
        brcontainer
        wrote on 7 Mar 2015, 18:14 last edited by brcontainer 3 Jul 2015, 18:15
        #3

        @SGaist said:

        Hi,
        You should run your application with the QT_DEBUG_PUGINS environment variable set to 1 > to see if the plugins are found and if they encounter a problem loading. You can do that in the run part of the Project panel

        Hope it helps

        Thanks, I added in Project > Build Environment this var QT_DEBUG_PLUGINS = 1 and work, returning this:

        http://pastebin.com/LVmLWASZ

        But it not show qtwebkitplugins.dll in the log.

        How can I solve this issue?

        QT project: https://github.com/brcontainer/qt-helper

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 Mar 2015, 20:31 last edited by
          #4

          Just thought of something, why didn't you call mingw32-make install ?

          Also did you enable the plugins in the QWebSettings of your application ?

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

          B 1 Reply Last reply 7 Mar 2015, 21:20
          0
          • S SGaist
            7 Mar 2015, 20:31

            Just thought of something, why didn't you call mingw32-make install ?

            Also did you enable the plugins in the QWebSettings of your application ?

            B Offline
            B Offline
            brcontainer
            wrote on 7 Mar 2015, 21:20 last edited by brcontainer 3 Jul 2015, 21:21
            #5

            @SGaist said:

            Just thought of something, why didn't you call mingw32-make install ?

            Also did you enable the plugins in the QWebSettings of your application ?

            Thank you for your dedication,

            How to call the mingw32-make install?

            QWebsettings:

            QWebSettings *settings = QWebSettings::globalSettings();
            settings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
            settings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
            settings->setAttribute(QWebSettings::LocalStorageEnabled, true);
            settings->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
            settings->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
            settings->setAttribute(QWebSettings::JavascriptEnabled, true);
            settings->setAttribute(QWebSettings::NotificationsEnabled, true);
            
            //Enable OpenGL/webGL
            settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);
            settings->setAttribute(QWebSettings::WebGLEnabled, true);
            
            settings->setAttribute(QWebSettings::PluginsEnabled, true);
            settings->setAttribute(QWebSettings::JavaEnabled, false);
            
            settings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
            
            settings->setAttribute(QWebSettings::AutoLoadImages, true);
            
            settings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
            settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
            
            settings->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
            settings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
            settings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, false);
            settings->setAttribute(QWebSettings::ScrollAnimatorEnabled, true);
            
            settings->setOfflineWebApplicationCachePath(pathApp + "appcache");
            settings->setOfflineStoragePath(pathApp + "offlinestorage");
            settings->setLocalStoragePath(pathApp + "storage");
            settings->setIconDatabasePath(pathApp + "icons");
            

            QT project: https://github.com/brcontainer/qt-helper

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 7 Mar 2015, 21:31 last edited by
              #6

              As silly as it may sound, just go in the same folder where you built the plugin and call mingw32-make install unless make has an other name on your system ?

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

              B 1 Reply Last reply 8 Mar 2015, 03:15
              0
              • S SGaist
                7 Mar 2015, 21:31

                As silly as it may sound, just go in the same folder where you built the plugin and call mingw32-make install unless make has an other name on your system ?

                B Offline
                B Offline
                brcontainer
                wrote on 8 Mar 2015, 03:15 last edited by brcontainer 3 Aug 2015, 04:56
                #7

                @SGaist said:

                As silly as it may sound, just go in the same folder where you built the plugin and call mingw32-make install unless make has an other name on your system ?

                Makefile generated: http://pastebin.com/dNyYJLH6

                After I tried this command mingw32-make && mingw32-make install, return this:

                cd src\ && ( if not exist Makefile C:\Qt5.4.0\5.4\mingw491_32\bin\qmake.exe C:\projects\qtwebkit-plugins-master\src\src.pro -o Makefile ) && mingw32-make -f Makefile
                mingw32-make[1]: Entering directory 'C:/projects/qtwebkit-plugins-master/src'
                mingw32-make -f Makefile.Release
                mingw32-make[2]: Entering directory 'C:/projects/qtwebkit-plugins-master/src'
                g++ -Wl,-s -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,C:\projects\qtwebkit-plugins-master\src..\bin\libqtwebkitplugins.a -o ..\bin\qtwebkitplugins.dll ../build/plugin.o ../build/spellcheck.o ../build/speller.o ../build/notificationpresenter.o ../build/qrc_notifications.o ../build/moc_qwebkitplatformplugin.o ../build/moc_plugin.o ../build/moc_spellcheck.o ../build/moc_notificationpresenter.o -lglu32 -lopengl32 -lgdi32 -luser32 -lhunspell -LC:/Qt5.4.0/5.4/mingw491_32/lib -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core
                mingw32-make[2]: Leaving directory 'C:/projects/qtwebkit-plugins-master/src'
                mingw32-make[1]: Leaving directory 'C:/projects/qtwebkit-plugins-master/src'
                cd src\ && ( if not exist Makefile C:\Qt5.4.0\5.4\mingw491_32\bin\qmake.exe C:\projects\qtwebkit-plugins-master\src\src.pro -o Makefile ) && mingw32-make -f Makefile install
                mingw32-make[1]: Entering directory 'C:/projects/qtwebkit-plugins-master/src'
                mingw32-make -f Makefile.Release install
                mingw32-make[2]: Entering directory 'C:/projects/qtwebkit-plugins-master/src'
                mingw32-make[2]: Nothing to be done for 'install'.
                mingw32-make[2]: Leaving directory 'C:/projects/qtwebkit-plugins-master/src'
                mingw32-make[1]: Leaving directory 'C:/projects/qtwebkit-plugins-master/src'

                I copied .dll and .a generated for mingw folder and tested my project with webview (with QT_DEBUG_PLUGINS = 1).

                If have focus in <input type="text"> or <textarea> or use Notification Web API Application output tab (in QtCreator) returns:

                Found metadata in lib C:/Qt5.4.0/5.4/mingw491_32/plugins/webkit/qtwebkitplugins.dll, metadata=
                {
                    "IID": "org.qtwebkit.QtWebKit.QtWebKitPlugin",
                    "MetaData": {
                    },
                    "className": "QtWebKitPlugin",
                    "debug": false,
                    "version": 328704
                }
                
                
                loaded library "C:/Qt5.4.0/5.4/mingw491_32/plugins/webkit/qtwebkitplugins.dll"
                QLibraryPrivate::unload succeeded on "C:/Qt5.4.0/5.4/mingw491_32/plugins/webkit/qtwebkitplugins.dll" 
                QSystemTrayIcon::setVisible: No Icon set
                

                It seems to me that the .dll is loaded, it just is not working. What did I do wrong?

                QT project: https://github.com/brcontainer/qt-helper

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  brcontainer
                  wrote on 8 Mar 2015, 08:53 last edited by brcontainer 3 Aug 2015, 09:58
                  #8

                  I solved

                  For this work in QT5.4+ is necessary to modified the qwebkitplatformplugin.h file

                  Change this:

                  QT_BEGIN_NAMESPACE
                  Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.9");
                  

                  By this:

                  QT_BEGIN_NAMESPACE
                  Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "org.qt-project.Qt.WebKit.PlatformPlugin/1.9");
                  

                  If needed compatibility with QT-4.8 change the code for this:

                  QT_BEGIN_NAMESPACE
                  #if QT_VERSION >= 0x050200
                  Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "org.qt-project.Qt.WebKit.PlatformPlugin/1.9")
                  #else
                  Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.9")
                  #endif
                  QT_END_NAMESPACE
                  

                  I send a pull-request https://github.com/QupZilla/qtwebkit-plugins/pull/4 in repository

                  QT project: https://github.com/brcontainer/qt-helper

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 8 Mar 2015, 15:01 last edited by
                    #9

                    Good catch !

                    Thanks for sharing your findings.

                    One last thing to do is mark the thread as solved so other forum users may know as solution has been found :)

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

                    B 1 Reply Last reply 8 Mar 2015, 20:33
                    1
                    • S SGaist
                      8 Mar 2015, 15:01

                      Good catch !

                      Thanks for sharing your findings.

                      One last thing to do is mark the thread as solved so other forum users may know as solution has been found :)

                      B Offline
                      B Offline
                      brcontainer
                      wrote on 8 Mar 2015, 20:33 last edited by
                      #10

                      @SGaist said:

                      One last thing to do is mark the thread as solved

                      How to do it? Nothing appears but the editing buttons and sharing on social networks.

                      Thanks.

                      QT project: https://github.com/brcontainer/qt-helper

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 8 Mar 2015, 20:40 last edited by
                        #11

                        Don't you have somewhere on the page a "Mark Solved" button ? Or Topic Tools -> Mark Solved ?

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

                        B 1 Reply Last reply 8 Mar 2015, 20:50
                        0
                        • S SGaist
                          8 Mar 2015, 20:40

                          Don't you have somewhere on the page a "Mark Solved" button ? Or Topic Tools -> Mark Solved ?

                          B Offline
                          B Offline
                          brcontainer
                          wrote on 8 Mar 2015, 20:50 last edited by
                          #12

                          @SGaist No, I migrated my account "qt-project.org/" and I think merge it with the account that already existed in "qt.io", perhaps the account has not been fully active.

                          See images:

                          Alt text
                          Alt text

                          QT project: https://github.com/brcontainer/qt-helper

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 8 Mar 2015, 20:55 last edited by
                            #13

                            Strange… Let's check with @tekojo tomorrow

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

                            B 2 Replies Last reply 8 Mar 2015, 21:05
                            1
                            • S SGaist
                              8 Mar 2015, 20:55

                              Strange… Let's check with @tekojo tomorrow

                              B Offline
                              B Offline
                              brcontainer
                              wrote on 8 Mar 2015, 21:05 last edited by
                              #14

                              @SGaist said:

                              Strange… Let's check with @tekojo tomorrow

                              Thanks!

                              QT project: https://github.com/brcontainer/qt-helper

                              1 Reply Last reply
                              0
                              • S SGaist
                                8 Mar 2015, 20:55

                                Strange… Let's check with @tekojo tomorrow

                                B Offline
                                B Offline
                                brcontainer
                                wrote on 10 Mar 2015, 13:59 last edited by
                                #15

                                @SGaist said:

                                Strange… Let's check with @tekojo tomorrow

                                I discovered, your account is moderator type (I think), my account is a normal user, so I'm not such a function, but @tekojo had an idea to use "tags" instead of this function, see: https://bugreports.qt.io/browse/QTWEBSITE-631

                                QT project: https://github.com/brcontainer/qt-helper

                                1 Reply Last reply
                                0

                                1/15

                                6 Mar 2015, 18:48

                                • Login

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