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.)