How to compile qtwebkit-plugins?
-
wrote on 6 Mar 2015, 18:48 last edited by A Former User
QtWebkit-plugins is a library that provides features to the
QWebView
egSpellCheck
andNotification Web API
.Read about:
I tried to compile the code in Windows, but my
QWebView
not working as expected, in other wordsSpellCheck
andNotification 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 useqmake
, so I tried to do the step-by-step to compile:- I compiled
hunspell
- Copied
hunspell
forC:\Qt5.4.0\5.4\mingw491_32\bin
andC:\Qt5.4.0\5.4\mingw491_32\lib
- Compiled the
qtwebkit-plugins.pro
project (clicked inBuild
onQtCreator
) - Build generate
libqtwebkitpluginsd.a
andqtwebkitplugins.dll
- Copied
libqtwebkitpluginsd.a
forC:\Qt5.4.0\5.4\mingw491_32\lib
- Copied
qtwebkitplugins.dll
forC:\Qt5.4.0\5.4\mingw491_32\plugins\webkit
andC:\Qt5.4.0\5.4\mingw491_32\bin
After that I compiled another simple project that uses
QWebView
then tested theSpellCheck
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?
- I compiled
-
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
-
wrote on 7 Mar 2015, 18:14 last edited by brcontainer 3 Jul 2015, 18:15
@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 panelHope it helps
Thanks, I added in
Project > Build Environment
this varQT_DEBUG_PLUGINS = 1
and work, returning this:But it not show
qtwebkitplugins.dll
in the log.How can I solve this issue?
-
Just thought of something, why didn't you call mingw32-make install ?
Also did you enable the plugins in the QWebSettings of your application ?
-
Just thought of something, why didn't you call mingw32-make install ?
Also did you enable the plugins in the QWebSettings of your application ?
wrote on 7 Mar 2015, 21:20 last edited by brcontainer 3 Jul 2015, 21:21@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");
-
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 ? -
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 ?wrote on 8 Mar 2015, 03:15 last edited by brcontainer 3 Aug 2015, 04:56@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 useNotification 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? -
wrote on 8 Mar 2015, 08:53 last edited by brcontainer 3 Aug 2015, 09:58
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
-
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 :)
-
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 :)
wrote on 8 Mar 2015, 20:33 last edited by@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.
-
Don't you have somewhere on the page a "Mark Solved" button ? Or Topic Tools -> Mark Solved ?
-
Don't you have somewhere on the page a "Mark Solved" button ? Or Topic Tools -> Mark Solved ?
wrote on 8 Mar 2015, 20:50 last edited by@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:
-
Strange… Let's check with @tekojo tomorrow
-
wrote on 8 Mar 2015, 21:05 last edited by
-
wrote on 10 Mar 2015, 13:59 last edited by
@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
1/15