在我开始之前,这是我的设置: Ubuntu 12.04.1 从软件中心默认安装 Qtcreator。
剩下的,我都在做qtcreator的事情
我想从 QT 助手中尝试一些示例:首页 > QtWebKit QML 模块;
代码很简单,如下所示:
import QtWebKit 1.0
WebView {
url: "http://www.nokia.com"
preferredWidth: 490
preferredHeight: 400
scale: 0.5
smooth: false
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是下面的错误
Qml debugging is enabled. Only use this in a safe environment!
file:///home/cyrildz/Public/Programming/UbuntuQml/UbuntuQml.qml:1:1: module "QtWebKit" is not installed
import QtWebKit 1.0
^
Run Code Online (Sandbox Code Playgroud)
我从 qtcreator 那里得到了这个错误,这阻止了我运行这个例子。
为了在我的桌面上设置 Qt5,我从http://developer.ubuntu.com/get-started/gomobile/ 获取了描述
那是 :
sudo add-apt-repository ppa:canonical-qt5-edgers/qt5-beta1 && sudo apt-get update && sudo apt-get install qt5-meta-full && echo 'export PATH=/opt/qt5/bin:$PATH' >> ~/.bashrc …Run Code Online (Sandbox Code Playgroud)