Environment
windows7 + VS2010 + QT5.2_opengl
Configure the development environment
1. Install VS2010
2. Install the QT 5.2
QT Website: http://qt-project.org/downloads
Download and install QT5.2: Qt 5.2.1 for Windows 32-bit (VS 2010, OpenGL, 517 MB)
3. Install Visual Studio Add-in for QT5
: Visual Studio Add-in 1.2.2 for Qt5
4. Configure VS 2010
Configuration path: QT5 ==> "Qt Options" ==> "Qt Versions" ==> Add
Default path: C: \ Qt \ Qt5.2.0 \ 5.2.0 \ msvc2010_opengl
Parse html
1. Establish the QtWebkit Project
Operation path: VS2010 ==> File ==> New ==> Project ==> "Qt5 Projects" ==> "Qt Application"
Notes
Select "WebKit" and "Webkit Widgets" in "Project Settings:
2. Add a header file
#include <QtGui><QtWebKit><QWebView>
3.1 parse an http url
Use the setUrl method of QWebView as follows:
));
Use the setUrl method of QWebView as follows:
));
Use the setHtml method of QWebView as follows:
<<
<QtWebKit> <QWebView> <fstream> <sstream> main (argc, * std: ifstream fin (<View Code