Ok. So I installed 4.2.0.19 and managed to get everything compiled. QT creator says ‘QML module not found (Sailfish.WebView).’ but if I build and send to phone it just works ™. And the app in question, which does not work with the old QTWebView does work with the new! Progress. New apps coming right up…
This depends on exactly what you mean by debugging. You can view the javascript console output in the device console log by setting EMBED_CONSOLE=1
, just as with the browser. Or did you mean something more interactive?
I can’t seem to make pixelRatio do anything.
I have this inside the WebViewPage
:
Component.onCompleted: {
WebEngineSettings.pixelRatio = 5
}
…but web pages look the same as if the setting wasn’t there. Any idea what i might have done wrong?
Also; the link to MDN at the bottom of this page seems to be dead.
Ok, that’s cool. That wasn’t possible with the QT WebView we had till now.
And here is an app demonstrating the new WebView component:
Indeed, code assistance for the Sailfish.WebView package is still missing in the initial release.
It’s probably in place with 3.6?
Unfortunately not, as this relies on bits supplied on the OS side. I.e., it will be fixed for build targets matching some of the future OS releases and it will remain unfixed for 4.2.0.21 build targets even with newer SDK.
Ok, is there any place other than here we should mention that? I just went and ignored the error which ‘just worked’ but might have ‘despaired’ it I didn’t have such a thick skull.
Anyone doing a forum search should find this thread quite easily. But if you have any ideas where else that could be mentioned, please let us know.
Random, but how long has the share API been part of the OS?
So I can hide it for older OS versions it doesn’t work on
See first post: The Sailfish OS 4.2.0 release …
API’s are sometimes part of the OS before they are official announced and allowed on harbour, like the WebView API which was inside the OS in 4.1 as dev but announced in 4.2…
Hence why I’m I’m asking.
4.2.0 introduced: Sharing system redone
With SDK 3.6.6 I got this message in QTCreator with Webview:
[W] unknown:1283 - file:///usr/lib/qt5/qml/Sailfish/Silica/PageStack.qml:1283:13: QML AnimatedLoader: (file:///usr/share/harbour-ieligweb/qml/pages/SailfishWebviewPage.qml:5:1: module “Sailfish.WebView” is not installed
import Sailfish.WebView 1.0
^)
The lines mention above in .pro and .yaml are added. Any hints? Thx.
And in the SDK installation directory in “mersdk/targets/…/qml/Sailfish/Silica” there is no entry for “WebView”. Is this needed? On the phone there are entries for WebView and Share.
I needed two or three takes to get it installed. I think I did a buildrequires to get the SDK to push it to the target. In any case, just including it in Requires didn’t work ‘the first time’. I should have documented.
As stated earlier, code assistance is missing for Sailfish.WebView in the initial release (4.2.0.21 build targets).
You can use Tools > Options > Sailfish OS > Build Engine > Manage Build Targets... > Manage Packages
to install sailfish-components-webview-qt5
under your 4.2.0.21 build targets, which will fix the module “Sailfish.WebView” is not installed
warning. But still, the code assistance for types provided by that module will not be available.
(If it was a true build-time dependency, the preferred way would be to add it to BuildRequires
as @poetaster suggested. But here we are adding it just to make the IDE happy, so it’s not a true build-time dependency. In future build targets it will be preinstalled by default.)
I’m sorry but you need to be a bit more specific. How-To for what?
@martyone , @vige : Thanks, but it is not solved for me. After installing sailfish-components-webview-qt5
the kits where invalid, a messages says: run make". So I made a new installation of the SDK without installing sailfish-components-webview-qt5
.
Now I got in deployment:
Please confirm installation on device.
harbour-ieligweb: nothing provides ld-linux-armhf.so.3 needed by harbour-ieligweb-0.4.0-1.i486 (code: 13)
Installation failed
This occurs at the end of the deployment process after confirming installation in the emulation machine.
This error is a new one for me from today. After installing SDK yesterday all was fine. Is there something to delete manually after deinstallation SDK?
The BuildRequires are set like descriped above incl. - qt5embedwidget. Is this enough?
Thx.