Smeegs
Smeegs

Reputation: 9224

How do I add the qtWebKit module to qt creator?

I'm working on an ubuntu touch app and I need to include the qtwebkit module. I'm a bit new to this and I can't figure out where to find and install modules.

Thanks

Upvotes: 2

Views: 4854

Answers (1)

user950779
user950779

Reputation:

There are a few Debian/Ubuntu packages that you will need:

sudo apt-get install libqt5webkit5 libqt5webkit5-dev libqt5webkit5-qmlwebkitplugin

The packages are difficult to find sometimes for certain modules. Just either use `apt-cache search 'package'" or the Synaptic Package Manager and type in qt along with the name of the module(such as "qtwebkit").

Here is an example of that module being included:

import QtQuick 2.0
import QtWebKit 3.0

Page {
    WebView {
        id: webview
        url: "http://qt-project.org"
        width: parent.width
        height: parent.height
        onNavigationRequested: {
            // detect URL scheme prefix, most likely an external link
            var schemaRE = /^\w+:/;
            if (schemaRE.test(request.url)) {
                request.action = WebView.AcceptRequest;
            } else {
                request.action = WebView.IgnoreRequest;
                // delegate request.url here
            }
        }
    }
}

Upvotes: 1

Related Questions