summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/webkitqml/flickrview/flickrview.pro7
-rw-r--r--examples/webkitqml/flickrview/flickrview.qml10
-rw-r--r--examples/webkitqml/flickrview/flickrview.qrc6
-rw-r--r--examples/webkitqml/flickrview/images/flickr.png (renamed from examples/webkitqml/shared/images/flickr.png)bin6818 -> 6818 bytes
-rw-r--r--examples/webkitqml/shared/LoadIndicator.qml2
-rw-r--r--examples/webkitqml/shared/main.cpp4
-rw-r--r--examples/webkitqml/shared/shared.qrc10
-rw-r--r--examples/webkitqml/youtubeview/content/YouTubeDialog.qml4
-rw-r--r--examples/webkitqml/youtubeview/youtubeview.pro3
-rw-r--r--examples/webkitqml/youtubeview/youtubeview.qml16
-rw-r--r--examples/webkitqml/youtubeview/youtubeview.qrc7
11 files changed, 48 insertions, 21 deletions
diff --git a/examples/webkitqml/flickrview/flickrview.pro b/examples/webkitqml/flickrview/flickrview.pro
index 33d9320..bc88cff 100644
--- a/examples/webkitqml/flickrview/flickrview.pro
+++ b/examples/webkitqml/flickrview/flickrview.pro
@@ -7,7 +7,8 @@ SOURCES += ../shared/main.cpp
mac: CONFIG -= app_bundle
+RESOURCES += flickrview.qrc \
+ ../shared/shared.qrc
+
target.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/flickrview
-qml.files = flickrview.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/flickrview
-INSTALLS += target qml
+INSTALLS += target
diff --git a/examples/webkitqml/flickrview/flickrview.qml b/examples/webkitqml/flickrview/flickrview.qml
index e5e3dfd..b303b1b 100644
--- a/examples/webkitqml/flickrview/flickrview.qml
+++ b/examples/webkitqml/flickrview/flickrview.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
import QtWebKit 3.0
import QtQuick.XmlListModel 2.0
-import "../shared"
+import "qrc:/shared" as Shared
Rectangle {
id: container
@@ -156,7 +156,7 @@ Rectangle {
left: parent.left
}
Image {
- source: "../shared/images/arrow.png"
+ source: "qrc:/shared/images/arrow.png"
width: 30
height: 30
visible: updateInfo.state != "update"
@@ -189,7 +189,7 @@ Rectangle {
}
}
- LoadIndicator {
+ Shared.LoadIndicator {
anchors.fill: parent
color: "black"
running: !listView.visible && model.status != XmlListModel.Error
@@ -247,9 +247,9 @@ Rectangle {
}
}
- LoadIndicator {
+ Shared.LoadIndicator {
anchors.fill: parent
- imageSource: "images/flickr.png"
+ imageSource: "qrc:/images/flickr.png"
running: webView.loading
}
}
diff --git a/examples/webkitqml/flickrview/flickrview.qrc b/examples/webkitqml/flickrview/flickrview.qrc
new file mode 100644
index 0000000..35c793c
--- /dev/null
+++ b/examples/webkitqml/flickrview/flickrview.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>flickrview.qml</file>
+ <file>images/flickr.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/webkitqml/shared/images/flickr.png b/examples/webkitqml/flickrview/images/flickr.png
index d0f0502..d0f0502 100644
--- a/examples/webkitqml/shared/images/flickr.png
+++ b/examples/webkitqml/flickrview/images/flickr.png
Binary files differ
diff --git a/examples/webkitqml/shared/LoadIndicator.qml b/examples/webkitqml/shared/LoadIndicator.qml
index 6d972e9..d181f15 100644
--- a/examples/webkitqml/shared/LoadIndicator.qml
+++ b/examples/webkitqml/shared/LoadIndicator.qml
@@ -44,7 +44,7 @@ Rectangle {
id: container
property bool running: false
- property string imageSource: "images/busy.png"
+ property string imageSource: "qrc:/shared/images/busy.png"
visible: running
diff --git a/examples/webkitqml/shared/main.cpp b/examples/webkitqml/shared/main.cpp
index c77a22b..ac1de3e 100644
--- a/examples/webkitqml/shared/main.cpp
+++ b/examples/webkitqml/shared/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
{
QGuiApplication app(argc,argv);
QQuickView view;
- view.setSource(QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + QLatin1String("/" QWEBKIT_EXAMPLE_NAME ".qml")));
+ view.setSource(QUrl("qrc:///"QWEBKIT_EXAMPLE_NAME".qml"));
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.show();
return app.exec();
diff --git a/examples/webkitqml/shared/shared.qrc b/examples/webkitqml/shared/shared.qrc
new file mode 100644
index 0000000..9aa4172
--- /dev/null
+++ b/examples/webkitqml/shared/shared.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/shared">
+ <file>images/arrow.png</file>
+ <file>images/busy.png</file>
+ <file>images/less.png</file>
+ <file>images/more.png</file>
+ <file>Button.qml</file>
+ <file>LoadIndicator.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/webkitqml/youtubeview/content/YouTubeDialog.qml b/examples/webkitqml/youtubeview/content/YouTubeDialog.qml
index b02400e..21bdc40 100644
--- a/examples/webkitqml/youtubeview/content/YouTubeDialog.qml
+++ b/examples/webkitqml/youtubeview/content/YouTubeDialog.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import "../../shared"
+import "qrc:/shared" as Shared
Rectangle {
id: container
@@ -77,7 +77,7 @@ Rectangle {
Component {
id: delegate
- Button {
+ Shared.Button {
buttonWidth: 200
text: name
onClicked: presetClicked(name)
diff --git a/examples/webkitqml/youtubeview/youtubeview.pro b/examples/webkitqml/youtubeview/youtubeview.pro
index cdc71e9..b67072f 100644
--- a/examples/webkitqml/youtubeview/youtubeview.pro
+++ b/examples/webkitqml/youtubeview/youtubeview.pro
@@ -14,3 +14,6 @@ INSTALLS += target qml
OTHER_FILES += \
player.html
+
+RESOURCES += youtubeview.qrc \
+ ../shared/shared.qrc
diff --git a/examples/webkitqml/youtubeview/youtubeview.qml b/examples/webkitqml/youtubeview/youtubeview.qml
index b002319..16873d6 100644
--- a/examples/webkitqml/youtubeview/youtubeview.qml
+++ b/examples/webkitqml/youtubeview/youtubeview.qml
@@ -41,8 +41,8 @@
import QtQuick 2.0
import QtWebKit 3.0
import QtQuick.XmlListModel 2.0
-import "content"
-import "../shared"
+import "qrc:/shared" as Shared
+import "qrc:/content" as Content
Rectangle {
id: container
@@ -77,7 +77,7 @@ Rectangle {
anchors.fill: parent
opacity: 0
- url: "content/player.html?" + currentVideo.vId
+ url: "qrc:///content/player.html?" + currentVideo.vId
Behavior on opacity { NumberAnimation { duration: 200 } }
@@ -105,7 +105,7 @@ Rectangle {
}
}
- YouTubeDialog {
+ Content.YouTubeDialog {
id: presetDialog
anchors.fill: parent
visible: false
@@ -190,7 +190,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: height
height: visible ? listView.contentItem.height : 0
- Image { anchors.centerIn: parent; width: 50; height: 50; source: "../shared/images/less.png" }
+ Image { anchors.centerIn: parent; width: 50; height: 50; source: "qrc:/shared/images/less.png" }
MouseArea {
anchors.fill: parent
onClicked: model.requestLess()
@@ -205,7 +205,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: height
height: visible ? listView.contentItem.height : 0
- Image { anchors.centerIn: parent; width: 50; height: 50; source: "../shared/images/more.png" }
+ Image { anchors.centerIn: parent; width: 50; height: 50; source: "qrc:/shared/images/more.png" }
MouseArea {
anchors.fill: parent
onClicked: model.requestMore()
@@ -240,7 +240,7 @@ Rectangle {
}
}
- LoadIndicator {
+ Shared.LoadIndicator {
anchors.fill: parent
color: "black"
running: panel.state == "list" && model.status != XmlListModel.Ready
@@ -308,7 +308,7 @@ Rectangle {
}
}
- Button {
+ Shared.Button {
id: button
buttonHeight: container.padding
buttonWidth: container.width
diff --git a/examples/webkitqml/youtubeview/youtubeview.qrc b/examples/webkitqml/youtubeview/youtubeview.qrc
new file mode 100644
index 0000000..1440b31
--- /dev/null
+++ b/examples/webkitqml/youtubeview/youtubeview.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>content/YouTubeDialog.qml</file>
+ <file>content/player.html</file>
+ <file>youtubeview.qml</file>
+ </qresource>
+</RCC>