Qtwebkit Beginner Example (with code)

Source: Internet
Author: User

WebKit is an open-source browser engine with the corresponding engine gecko (the typesetting engine used by Mozilla Firefox) and Trident (also known as the typesetting engine used by Mshtml,ie). WebKit is also the name of the Apple Mac OS X System engine framework version, used primarily for safari,dashboard,mail and some other Mac OS X programs. WebKit contains the WebCore typesetting engine and Jscore engine from KDE khtml and KJS, when Apple compared Gecko and khtml, still chose the latter, because it has a clear source structure, very fast rendering speed.

Now QT built a WebKit engine for us to develop Hybird program, after countless small errors, I finally made out the first qtwebkit program = =;

The first line of the pro file is modified to:

QT       + + core GUI WebKit webkitwidgets network
Main.cpp:

#include "mainwindow.h" #include <QApplication> #include <QtWebKitWidgets/QWebView>// Notice that Qwebview is inside the webkitwidgets, not webkit. int main (int argc, char *argv[])//parameter must be written otherwise error {    qapplication a (argc, argv);    Qwebview *view=new Qwebview;    View->load (Qurl ("http://baidu.com"));//Pay attention to the case of Qurl!!!    view->show ();    return a.exec ();}

Operating effect:



The Ps:webkit core supports a variety of HTML5 's brilliant effects

Qtwebkit Beginner Example (with code)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.