summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SlideDeck.qml10
-rw-r--r--WebKitSlideContent.qml84
-rw-r--r--WebkitSlide.qml80
3 files changed, 95 insertions, 79 deletions
diff --git a/SlideDeck.qml b/SlideDeck.qml
index cb8f85f..36416db 100644
--- a/SlideDeck.qml
+++ b/SlideDeck.qml
@@ -82,7 +82,7 @@ OpacityTransitionPresentation {
writeInText: "The following is a quick tour of what is new in Qt 5.
-It is an application written with Qt Quick, based on Qt 5. The source\ncode is available from:
+It is an application written with Qt Quick, based on Qt 5. The source code is available from:
https://qt.gitorious.org/qt-labs/qt5-launch-demo
@@ -108,7 +108,7 @@ We hope you will enjoy Qt 5 as much as we have enjoyed creating it."
Slide {
- writeInText: "OpenGL-based scene graph for Qt Quick 2.0 - providing velvet\nanimations, particles and impressive graphical effects
+ writeInText: "OpenGL-based scene graph for Qt Quick 2.0 - providing velvet animations, particles and impressive graphical effects
Multimedia - Audio, Video and Camera support on all major platforms
@@ -125,11 +125,11 @@ JSON Support - Fast parser and writer, binary format support"
}
Slide {
- writeInText: "Modularization of the Qt libraries - sanitizing our codebase and\nsimplifying deployment
+ writeInText: "Modularization of the Qt libraries - sanitizing our codebase and simplifying deployment
-Qt Platform Abstraction - Unifying the Qt codebase across platforms,\nminimizing the porting effort for new platforms
+Qt Platform Abstraction - Unifying the Qt codebase across platforms, minimizing the porting effort for new platforms
-Wayland support - Wayland-compatible Qt backend and\ncompositor framework"
+Wayland support - Wayland-compatible Qt backend and compositor framework"
}
diff --git a/WebKitSlideContent.qml b/WebKitSlideContent.qml
new file mode 100644
index 0000000..ea5a364
--- /dev/null
+++ b/WebKitSlideContent.qml
@@ -0,0 +1,84 @@
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+import QtWebKit 3.0
+
+Item {
+ id: slide
+
+ anchors.fill: parent;
+
+ WebView {
+ id: browser
+ anchors.fill: parent
+ url: editor.text
+
+ // This works around rendering bugs in webkit. CSS animations
+ // and webGL content gets a bad offset, but this hack
+ // clips it so it is not visible. Not ideal, but it kinda works
+ // for now.
+ layer.enabled: true
+ layer.smooth: true
+ }
+
+ Rectangle {
+ border.width: 2
+ border.color: "black"
+ opacity: 0.5
+ color: "black"
+ anchors.fill: editor
+ anchors.margins: -editor.height * 0.2;
+
+ radius: -anchors.margins
+ antialiasing: true
+ }
+
+ TextInput {
+ id: editor
+ anchors.top: browser.bottom;
+ anchors.horizontalCenter: browser.horizontalCenter
+ font.pixelSize: slide.height * 0.05;
+ text: "http://qt.digia.com"
+ onAccepted: browser.reload();
+ color: "white"
+
+ onCursorPositionChanged: {
+ var rect = positionToRectangle(cursorPosition);
+ emitter.x = rect.x;
+ emitter.y = rect.y;
+ emitter.width = rect.width;
+ emitter.height = rect.height;
+ emitter.burst(10);
+ }
+
+ ParticleSystem {
+ id: sys1
+ running: slide.visible
+ }
+
+ ImageParticle {
+ system: sys1
+ source: "images/particle.png"
+ color: "white"
+ colorVariation: 0.2
+ alpha: 0
+ }
+
+ Emitter {
+ id: emitter
+ system: sys1
+
+ enabled: false
+
+ lifeSpan: 2000
+
+ velocity: PointDirection { xVariation: 30; yVariation: 30; }
+ acceleration: PointDirection {xVariation: 30; yVariation: 30; y: 100 }
+
+ endSize: 0
+
+ size: 8
+ sizeVariation: 2
+ }
+ }
+
+}
diff --git a/WebkitSlide.qml b/WebkitSlide.qml
index 5a1919f..5ff70b2 100644
--- a/WebkitSlide.qml
+++ b/WebkitSlide.qml
@@ -1,6 +1,4 @@
import QtQuick 2.0
-import QtQuick.Particles 2.0
-import QtWebKit 3.0
import Qt.labs.presentation 1.0
Slide {
@@ -8,80 +6,14 @@ Slide {
title: "Qt WebKit - WebView"
- WebView {
- id: browser
- anchors.fill: parent
- url: editor.text
-
- // This works around rendering bugs in webkit. CSS animations
- // and webGL content gets a bad offset, but this hack
- // clips it so it is not visible. Not ideal, but it kinda works
- // for now.
- layer.enabled: true
- layer.smooth: true
- }
-
- Rectangle {
- border.width: 2
- border.color: "black"
- opacity: 0.5
- color: "black"
- anchors.fill: editor
- anchors.margins: -editor.height * 0.2;
-
- radius: -anchors.margins
- antialiasing: true
- }
-
- TextInput {
- id: editor
- anchors.top: browser.bottom;
- anchors.horizontalCenter: browser.horizontalCenter
- font.pixelSize: slide.baseFontSize;
- text: "http://qt.digia.com"
- onAccepted: browser.reload();
- color: "white"
-
- onCursorPositionChanged: {
- var rect = positionToRectangle(cursorPosition);
- emitter.x = rect.x;
- emitter.y = rect.y;
- emitter.width = rect.width;
- emitter.height = rect.height;
- emitter.burst(10);
- }
-
- ParticleSystem {
- id: sys1
- running: slide.visible
- }
+ Loader {
+ id: webkitLoader
- ImageParticle {
- system: sys1
- source: "images/particle.png"
- color: "white"
- colorVariation: 0.2
- alpha: 0
- }
-
- Emitter {
- id: emitter
- system: sys1
-
- enabled: false
-
- lifeSpan: 2000
-
- velocity: PointDirection { xVariation: 30; yVariation: 30; }
- acceleration: PointDirection {xVariation: 30; yVariation: 30; y: 100 }
-
- endSize: 0
+ anchors.fill: parent
- size: 8
- sizeVariation: 2
- }
+ source: "WebKitSlideContent.qml"
}
-
-
+ centeredText: webkitLoader.status == Loader.Error ? "Qt WebKit not installed or otherwise failed to load" : ""
}
+