summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/calculator/Core/calculator.js4
-rw-r--r--demos/declarative/calculator/calculator.qml14
-rw-r--r--demos/declarative/flickr/flickr.qml22
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml130
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml22
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/Button.qml2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml2
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js4
-rw-r--r--demos/declarative/snake/content/Link.qml2
-rw-r--r--demos/declarative/twitter/TwitterCore/Button.qml2
-rw-r--r--demos/declarative/webbrowser/content/UrlInput.qml2
-rw-r--r--demos/embedded/anomaly/anomaly.pro2
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp33
-rw-r--r--demos/embedded/anomaly/src/BrowserView.h3
-rw-r--r--demos/embedded/desktopservices/contenttab.cpp2
-rw-r--r--demos/embedded/desktopservices/desktopwidget.cpp2
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.cpp2
-rw-r--r--demos/embedded/fluidlauncher/pictureflow.cpp2
-rw-r--r--demos/embedded/lightmaps/lightmaps.cpp49
-rw-r--r--demos/embedded/lightmaps/lightmaps.pro2
-rw-r--r--demos/embedded/qmlcalculator/deployment.pri1
-rw-r--r--demos/embedded/qmlclocks/deployment.pri1
-rw-r--r--demos/embedded/qmldialcontrol/deployment.pri1
-rw-r--r--demos/embedded/qmleasing/deployment.pri1
-rw-r--r--demos/embedded/qmlflickr/deployment.pri1
-rw-r--r--demos/embedded/qmlflickr/qmlflickr.cpp63
-rw-r--r--demos/embedded/qmlflickr/qmlflickr.pro2
-rw-r--r--demos/embedded/qmlphotoviewer/deployment.pri1
-rw-r--r--demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp63
-rw-r--r--demos/embedded/qmlphotoviewer/qmlphotoviewer.pro2
-rw-r--r--demos/embedded/qmltwitter/deployment.pri1
-rw-r--r--demos/embedded/qmltwitter/qmltwitter.cpp63
-rw-r--r--demos/embedded/qmltwitter/qmltwitter.pro2
-rw-r--r--demos/embedded/raycasting/raycasting.cpp2
-rw-r--r--demos/qtdemo/colors.cpp6
-rw-r--r--demos/qtdemo/colors.h1
-rw-r--r--demos/qtdemo/mainwindow.cpp8
-rw-r--r--demos/qtdemo/menumanager.cpp20
-rw-r--r--demos/qtdemo/qmlShell.qml56
39 files changed, 323 insertions, 275 deletions
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js
index c80c42f..16cc309 100644
--- a/demos/declarative/calculator/Core/calculator.js
+++ b/demos/declarative/calculator/Core/calculator.js
@@ -83,9 +83,9 @@ function doOperation(op) {
display.text ="0"
}
- if (op == rotateLeft)
- main.state = "orientation " + Orientation.Landscape
if (op == rotateRight)
+ main.state = "orientation " + Orientation.Landscape
+ if (op == rotateLeft)
main.state = ''
}
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 63b6c55..288455b 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -85,7 +85,7 @@ Rectangle {
Button {
id: rotateButton
- width: column.w; height: column.h; color: 'purple'; operation: rotateLeft
+ width: column.w; height: column.h; color: 'purple'; operation: rotateRight
}
Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
@@ -134,18 +134,18 @@ Rectangle {
states: [
State {
name: "orientation " + Orientation.Landscape
- PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateRight }
+ PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
},
State {
name: "orientation " + Orientation.PortraitInverted
- PropertyChanges { target: main; rotation: -180; }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
+ PropertyChanges { target: main; rotation: 180; }
+ PropertyChanges { target: rotateButton; operation: rotateRight }
},
State {
name: "orientation " + Orientation.LandscapeInverted
- PropertyChanges { target: main; rotation: -270; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateRight }
+ PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
}
]
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 48db476..152f9f9 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -57,21 +57,20 @@ Item {
Item {
id: views
- x: 2; width: parent.width - 4
+ width: parent.width
anchors.top: titleBar.bottom; anchors.bottom: toolBar.top
- Mobile.GridDelegate { id: gridDelegate }
GridView {
- x: (width/4-79)/2; y: x
- id: photoGridView; model: rssModel; delegate: gridDelegate; cacheBuffer: 100
- cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height - 1; z: 6
+ id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {}
+ cacheBuffer: 100
+ cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
}
- Mobile.ListDelegate { id: listDelegate }
ListView {
- id: photoListView; model: rssModel; delegate: listDelegate; z: 6
+ id: photoListView; model: rssModel; delegate: Mobile.ListDelegate { }
width: parent.width; height: parent.height; x: -(parent.width * 1.5); cacheBuffer: 100;
}
+
states: State {
name: "ListView"; when: screen.inListView == true
PropertyChanges { target: photoListView; x: 0 }
@@ -81,13 +80,16 @@ Item {
transitions: Transition {
NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
}
+
+ Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height }
+
+ Item { id: foreground; anchors.fill: parent }
}
- Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height; z:1 }
- Mobile.TitleBar { id: titleBar; z: 5; width: parent.width; height: 40; opacity: 0.9 }
+ Mobile.TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 }
Mobile.ToolBar {
- id: toolBar; z: 5
+ id: toolBar
height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
button1Label: "Update"; button2Label: "View mode"
onButton1Clicked: rssModel.reload()
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index cbb00a2..c368e95 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -39,75 +39,73 @@
**
****************************************************************************/
- import Qt 4.7
+import Qt 4.7
- Component {
- id: photoDelegate
- Item {
- id: wrapper; width: 79; height: 79
+Item {
+ id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight
- function photoClicked() {
- imageDetails.photoTitle = title;
- imageDetails.photoTags = tags;
- imageDetails.photoWidth = photoWidth;
- imageDetails.photoHeight = photoHeight;
- imageDetails.photoType = photoType;
- imageDetails.photoAuthor = photoAuthor;
- imageDetails.photoDate = photoDate;
- imageDetails.photoUrl = url;
- imageDetails.rating = 0;
- scaleMe.state = "Details";
- }
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
+ }
- Item {
- anchors.centerIn: parent
- scale: 0.0
- Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
- id: scaleMe
+ Item {
+ anchors.centerIn: parent
+ scale: 0.0
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
+ id: scaleMe
- Rectangle { height: 79; width: 79; id: blackRect; anchors.centerIn: parent; color: "black"; smooth: true }
- Rectangle {
- id: whiteRect; width: 77; height: 77; anchors.centerIn: parent; color: "#dddddd"; smooth: true
- Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true}
- Image { source: "images/gloss.png" }
- }
+ Item {
+ width: 77; height: 77; anchors.centerIn: parent
+ Rectangle {
+ id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true
+ Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true }
+ Image { source: "images/gloss.png" }
+ }
+ }
- Connections {
- target: toolBar
- onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
- }
+ Connections {
+ target: toolBar
+ onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
+ }
+
+ states: [
+ State {
+ name: "Show"; when: thumb.status == Image.Ready
+ PropertyChanges { target: scaleMe; scale: 1 }
+ },
+ State {
+ name: "Details"
+ PropertyChanges { target: scaleMe; scale: 1 }
+ ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer }
+ PropertyChanges { target: background; state: "DetailedView" }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "Show"; to: "Details"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ },
+ Transition {
+ from: "Details"; to: "Show"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+ ]
+ }
+ MouseArea { anchors.fill: wrapper; onClicked: photoClicked() }
+}
- states: [
- State {
- name: "Show"; when: thumb.status == Image.Ready
- PropertyChanges { target: scaleMe; scale: 1 }
- },
- State {
- name: "Details"
- PropertyChanges { target: scaleMe; scale: 1 }
- ParentChange { target: wrapper; parent: imageDetails.frontContainer }
- PropertyChanges { target: wrapper; x: 20; y: 60; z: 1000 }
- PropertyChanges { target: background; state: "DetailedView" }
- }
- ]
- transitions: [
- Transition {
- from: "Show"; to: "Details"
- ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
- }
- },
- Transition {
- from: "Details"; to: "Show"
- SequentialAnimation {
- ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
- }
- PropertyAction { targets: wrapper; properties: "z" }
- }
- }
- ]
- }
- MouseArea { anchors.fill: wrapper; onClicked: { photoClicked() } }
- }
- }
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index b1a7359..ff902ce 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -45,7 +45,7 @@ import "../common" as Common
Flipable {
id: container
- property variant frontContainer: containerFront
+ property alias frontContainer: containerFront
property string photoTitle: ""
property string photoTags: ""
property int photoWidth
@@ -76,17 +76,17 @@ Flipable {
Column {
spacing: 10
anchors {
- left: parent.left; leftMargin: 20
- right: parent.right; rightMargin: 20
- top: parent.top; topMargin: 180
+ left: parent.left; leftMargin: 10
+ right: parent.right; rightMargin: 10
+ top: parent.top; topMargin: 120
}
- Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle }
- Text { color: "white"; elide: Text.ElideRight; text: "<b>Size:</b> " + container.photoWidth + 'x' + container.photoHeight }
- Text { color: "white"; elide: Text.ElideRight; text: "<b>Type:</b> " + container.photoType }
- Text { color: "white"; elide: Text.ElideRight; text: "<b>Author:</b> " + container.photoAuthor }
- Text { color: "white"; elide: Text.ElideRight; text: "<b>Published:</b> " + container.photoDate }
- Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "<b>Tags:</b> " }
- Text { color: "white"; elide: Text.ElideRight; text: container.photoTags }
+ Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width }
}
}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
index a60d5ca..47b90c8 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
@@ -45,7 +45,7 @@ Item {
id: container
property alias label: labelText.text
- property string tint: ""
+ property color tint: "transparent"
signal clicked
width: labelText.width + 70 ; height: labelText.height + 18
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
index be7dfa4..decc0fe 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -81,6 +81,6 @@ Item {
MouseArea {
anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
- onClicked: { textInput.forceFocus(); textInput.openSoftwareInputPanel(); }
+ onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); }
}
}
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index 6e1b24d..aa1b359 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -110,7 +110,7 @@ function shuffleDown()
}else{
if(fallDist > 0){
var obj = board[index(column,row)];
- obj.y += fallDist * gameCanvas.blockSize;
+ obj.y = (row+fallDist) * gameCanvas.blockSize;
board[index(column,row+fallDist)] = obj;
board[index(column,row)] = null;
}
@@ -128,7 +128,7 @@ function shuffleDown()
obj = board[index(column,row)];
if(obj == null)
continue;
- obj.x -= fallDist * gameCanvas.blockSize;
+ obj.x = (column-fallDist) * gameCanvas.blockSize;
board[index(column-fallDist,row)] = obj;
board[index(column,row)] = null;
}
diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml
index f4d7165..9aa6006 100644
--- a/demos/declarative/snake/content/Link.qml
+++ b/demos/declarative/snake/content/Link.qml
@@ -73,14 +73,12 @@ Item { id:link
}
}
- /*
transform: Rotation {
id: actualImageRotation
origin.x: width/2; origin.y: height/2;
angle: rotation * 90
Behavior on angle { NumberAnimation { duration: spawned ? 200 : 0} }
}
- */
}
Image {
diff --git a/demos/declarative/twitter/TwitterCore/Button.qml b/demos/declarative/twitter/TwitterCore/Button.qml
index 9c90c2c..d326c64 100644
--- a/demos/declarative/twitter/TwitterCore/Button.qml
+++ b/demos/declarative/twitter/TwitterCore/Button.qml
@@ -80,7 +80,7 @@ Item {
},
State {
name: "Focused"
- when: container.focus == true
+ when: container.activeFocus == true
PropertyChanges { target: btnText; color: "#FFFFFF" }
}
]
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml
index 9992456..4f49821 100644
--- a/demos/declarative/webbrowser/content/UrlInput.qml
+++ b/demos/declarative/webbrowser/content/UrlInput.qml
@@ -69,7 +69,7 @@ Item {
TextInput {
id: urlText
horizontalAlignment: TextEdit.AlignLeft
- font.pixelSize: 14; focusOnPress: true
+ font.pixelSize: 14;
onTextChanged: container.urlChanged()
diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
index 584e5cd..a786b46 100644
--- a/demos/embedded/anomaly/anomaly.pro
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -26,8 +26,6 @@ RESOURCES += src/anomaly.qrc
symbian {
TARGET.UID3 = 0xA000CF71
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
index a6e6f7a..73d0b70 100644
--- a/demos/embedded/anomaly/src/BrowserView.cpp
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -51,10 +51,6 @@
#include "webview.h"
#include "ZoomStrip.h"
-#if defined (Q_OS_SYMBIAN)
-#include "sym_iap_util.h"
-#endif
-
BrowserView::BrowserView(QWidget *parent)
: QWidget(parent)
, m_titleBar(0)
@@ -71,6 +67,26 @@ BrowserView::BrowserView(QWidget *parent)
m_zoomLevels << 100;
m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id =
+ settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system
+ // default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ m_webView->page()->networkAccessManager()->setConfiguration(config);
+ }
+
QTimer::singleShot(0, this, SLOT(initialize()));
}
@@ -100,9 +116,6 @@ void BrowserView::initialize()
m_webView->setHtml("about:blank");
m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_webView->setFocus();
-#ifdef Q_OS_SYMBIAN
- QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-#endif
}
void BrowserView::start()
@@ -173,12 +186,6 @@ void BrowserView::resizeEvent(QResizeEvent *event)
int zh = m_zoomStrip->sizeHint().height();
m_zoomStrip->move(width() - zw, (height() - zh) / 2);
}
-#ifdef Q_OS_SYMBIAN
-void BrowserView::setDefaultIap()
-{
- qt_SetDefaultIap();
-}
-#endif
void BrowserView::navigate(const QUrl &url)
{
diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h
index 5ab1dd7..8981582 100644
--- a/demos/embedded/anomaly/src/BrowserView.h
+++ b/demos/embedded/anomaly/src/BrowserView.h
@@ -63,9 +63,6 @@ public slots:
void navigate(const QUrl &url);
void zoomIn();
void zoomOut();
-#ifdef Q_OS_SYMBIAN
- void setDefaultIap();
-#endif
private slots:
void initialize();
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp
index fa9c586..8b344ce 100644
--- a/demos/embedded/desktopservices/contenttab.cpp
+++ b/demos/embedded/desktopservices/contenttab.cpp
@@ -125,7 +125,7 @@ void ContentTab::keyPressEvent(QKeyEvent *event)
void ContentTab::handleErrorInOpen(QListWidgetItem *item)
{
Q_UNUSED(item);
- QMessageBox::warning(this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close);
+ QMessageBox::warning(this, tr("Operation Failed"), tr("Unknown error!"), QMessageBox::Close);
}
// NEW SLOTS
diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp
index 39a56a4..ff3cb09 100644
--- a/demos/embedded/desktopservices/desktopwidget.cpp
+++ b/demos/embedded/desktopservices/desktopwidget.cpp
@@ -73,7 +73,7 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent)
// Links
LinkTab* othersTab = new LinkTab(tabWidget);;
- // Given icon file will be overriden by LinkTab
+ // Given icon file will be overridden by LinkTab
othersTab->init(QDesktopServices::PicturesLocation, "", "");
tabWidget->addTab(othersTab, tr("Links"));
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp
index 1fb2376..19eb8d2 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.cpp
+++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp
@@ -154,7 +154,7 @@ void FluidLauncher::parseDemos(QXmlStreamReader& reader)
DemoApplication* newDemo = new DemoApplication(
filename.toString(),
- name.isEmpty() ? "Unamed Demo" : name.toString(),
+ name.isEmpty() ? "Unnamed Demo" : name.toString(),
image.toString(),
args.toString().split(" "));
demoList.append(newDemo);
diff --git a/demos/embedded/fluidlauncher/pictureflow.cpp b/demos/embedded/fluidlauncher/pictureflow.cpp
index 8435c8f..d606269 100644
--- a/demos/embedded/fluidlauncher/pictureflow.cpp
+++ b/demos/embedded/fluidlauncher/pictureflow.cpp
@@ -603,7 +603,7 @@ static QImage prepareSurface(QImage img, int w, int h)
Qt::TransformationMode mode = Qt::SmoothTransformation;
img = img.scaled(w, h, Qt::IgnoreAspectRatio, mode);
- // slightly larger, to accomodate for the reflection
+ // slightly larger, to accommodate for the reflection
int hs = h * 2;
int hofs = h / 3;
diff --git a/demos/embedded/lightmaps/lightmaps.cpp b/demos/embedded/lightmaps/lightmaps.cpp
index c76aed0..2eb1733 100644
--- a/demos/embedded/lightmaps/lightmaps.cpp
+++ b/demos/embedded/lightmaps/lightmaps.cpp
@@ -43,10 +43,6 @@
#include <QtGui>
#include <QtNetwork>
-#if defined (Q_OS_SYMBIAN)
-#include "sym_iap_util.h"
-#endif
-
#include <math.h>
#ifndef M_PI
@@ -490,6 +486,7 @@ class MapZoom : public QMainWindow
private:
LightMaps *map;
+ QNetworkSession *networkSession;
public:
MapZoom(): QMainWindow(0) {
@@ -526,15 +523,49 @@ public:
menu->addAction(osmAction);
#endif
- QTimer::singleShot(0, this, SLOT(delayedInit()));
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id =
+ settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system
+ // default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ networkSession = new QNetworkSession(config, this);
+ connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+
+ networkSession->open();
+ } else {
+ networkSession = 0;
+ }
}
private slots:
- void delayedInit() {
-#if defined(Q_OS_SYMBIAN)
- qt_SetDefaultIap();
-#endif
+ void sessionOpened() {
+ // Save the used configuration
+ QNetworkConfiguration config = networkSession->configuration();
+ QString id;
+ if (config.type() == QNetworkConfiguration::UserChoice) {
+ id = networkSession->sessionProperty(
+ QLatin1String("UserChoiceConfiguration")).toString();
+ } else {
+ id = config.identifier();
+ }
+
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+ settings.endGroup();
}
void chooseOslo() {
diff --git a/demos/embedded/lightmaps/lightmaps.pro b/demos/embedded/lightmaps/lightmaps.pro
index ee4cc5a..9d83721 100644
--- a/demos/embedded/lightmaps/lightmaps.pro
+++ b/demos/embedded/lightmaps/lightmaps.pro
@@ -5,8 +5,6 @@ QT += network
symbian {
TARGET.UID3 = 0xA000CF75
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri
index 53c6dbf..a31303d 100644
--- a/demos/embedded/qmlcalculator/deployment.pri
+++ b/demos/embedded/qmlcalculator/deployment.pri
@@ -1,5 +1,6 @@
qmlcalculator_src = $$PWD/../../declarative/calculator
symbian {
+ load(data_caging_paths)
qmlcalculator_uid3 = A000E3FB
qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3
}
diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri
index 03ba129..0946733 100644
--- a/demos/embedded/qmlclocks/deployment.pri
+++ b/demos/embedded/qmlclocks/deployment.pri
@@ -1,5 +1,6 @@
qmlclocks_src = $$PWD/../../../examples/declarative/toys/clocks
symbian {
+ load(data_caging_paths)
qmlclocks_uid3 = A000E3FC
qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3
}
diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri
index 097c74c..e0e72e6 100644
--- a/demos/embedded/qmldialcontrol/deployment.pri
+++ b/demos/embedded/qmldialcontrol/deployment.pri
@@ -1,5 +1,6 @@
qmldialcontrol_src = $$PWD/../../../examples/declarative/ui-components/dialcontrol
symbian {
+ load(data_caging_paths)
qmldialcontrol_uid3 = A000E3FD
qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3
}
diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri
index 47192e6..984f5c8 100644
--- a/demos/embedded/qmleasing/deployment.pri
+++ b/demos/embedded/qmleasing/deployment.pri
@@ -1,5 +1,6 @@
qmleasing_src = $$PWD/../../../examples/declarative/animation/easing
symbian {
+ load(data_caging_paths)
qmleasing_uid3 = A000E3FE
qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3
}
diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri
index c8fef1a..b508292 100644
--- a/demos/embedded/qmlflickr/deployment.pri
+++ b/demos/embedded/qmlflickr/deployment.pri
@@ -1,5 +1,6 @@
qmlflickr_src = $$PWD/../../declarative/flickr
symbian {
+ load(data_caging_paths)
qmlflickr_uid3 = A000E3FF
qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3
}
diff --git a/demos/embedded/qmlflickr/qmlflickr.cpp b/demos/embedded/qmlflickr/qmlflickr.cpp
index 6f0c528..7068f88 100644
--- a/demos/embedded/qmlflickr/qmlflickr.cpp
+++ b/demos/embedded/qmlflickr/qmlflickr.cpp
@@ -40,41 +40,59 @@
****************************************************************************/
#include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
#include <QtGui/QApplication>
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
{
-Q_OBJECT
public:
- QmlAppView(QWidget *parent = 0)
- : QDeclarativeView(parent)
- {
- QTimer::singleShot(0, this, SLOT(setDefaultIap()));
- }
+ ~NetworkAccessManagerFactory() { }
-private slots:
- void setDefaultIap()
- {
- qt_SetDefaultIap();
- }
+ QNetworkAccessManager *create(QObject *parent);
};
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+ QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ accessManager->setConfiguration(config);
+ }
+
+ return accessManager;
+}
int main(int argc, char *argv[])
{
QApplication application(argc, argv);
+ NetworkAccessManagerFactory networkAccessManagerFactory;
+
const QString mainQmlApp = QLatin1String("flickr.qml");
- QmlAppView view;
+ QDeclarativeView view;
+ view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
view.setSource(QUrl(mainQmlApp));
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
return application.exec();
}
-#if defined(Q_OS_SYMBIAN)
-#include "qmlflickr.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmlflickr/qmlflickr.pro b/demos/embedded/qmlflickr/qmlflickr.pro
index e706134..39b316a 100644
--- a/demos/embedded/qmlflickr/qmlflickr.pro
+++ b/demos/embedded/qmlflickr/qmlflickr.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
symbian {
TARGET.UID3 = 0x$$qmlflickr_uid3 # defined in deployment.pri
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri
index 128a1f7..35937a8 100644
--- a/demos/embedded/qmlphotoviewer/deployment.pri
+++ b/demos/embedded/qmlphotoviewer/deployment.pri
@@ -1,5 +1,6 @@
qmlphotoviewer_src = $$PWD/../../declarative/photoviewer
symbian {
+ load(data_caging_paths)
qmlphotoviewer_uid3 = A000E400
qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3
}
diff --git a/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp b/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
index 7889842..2b9db5e 100644
--- a/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
+++ b/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
@@ -40,41 +40,59 @@
****************************************************************************/
#include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
#include <QtGui/QApplication>
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
{
-Q_OBJECT
public:
- QmlAppView(QWidget *parent = 0)
- : QDeclarativeView(parent)
- {
- QTimer::singleShot(0, this, SLOT(setDefaultIap()));
- }
+ ~NetworkAccessManagerFactory() { }
-private slots:
- void setDefaultIap()
- {
- qt_SetDefaultIap();
- }
+ QNetworkAccessManager *create(QObject *parent);
};
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+ QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ accessManager->setConfiguration(config);
+ }
+
+ return accessManager;
+}
int main(int argc, char *argv[])
{
QApplication application(argc, argv);
+ NetworkAccessManagerFactory networkAccessManagerFactory;
+
const QString mainQmlApp = QLatin1String("photoviewer.qml");
- QmlAppView view;
+ QDeclarativeView view;
+ view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
view.setSource(QUrl(mainQmlApp));
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
return application.exec();
}
-#if defined(Q_OS_SYMBIAN)
-#include "qmlphotoviewer.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro b/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
index ead5e67..a4234cf 100644
--- a/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
+++ b/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
symbian {
TARGET.UID3 = 0x$$qmlphotoviewer_uid3 # defined in deployment.pri
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri
index 40c53ad..4404e33 100644
--- a/demos/embedded/qmltwitter/deployment.pri
+++ b/demos/embedded/qmltwitter/deployment.pri
@@ -1,5 +1,6 @@
qmltwitter_src = $$PWD/../../declarative/twitter
symbian {
+ load(data_caging_paths)
qmltwitter_uid3 = A000E401
qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3
}
diff --git a/demos/embedded/qmltwitter/qmltwitter.cpp b/demos/embedded/qmltwitter/qmltwitter.cpp
index e30ab24..c53098a4 100644
--- a/demos/embedded/qmltwitter/qmltwitter.cpp
+++ b/demos/embedded/qmltwitter/qmltwitter.cpp
@@ -40,41 +40,59 @@
****************************************************************************/
#include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
#include <QtGui/QApplication>
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
{
-Q_OBJECT
public:
- QmlAppView(QWidget *parent = 0)
- : QDeclarativeView(parent)
- {
- QTimer::singleShot(0, this, SLOT(setDefaultIap()));
- }
+ ~NetworkAccessManagerFactory() { }
-private slots:
- void setDefaultIap()
- {
- qt_SetDefaultIap();
- }
+ QNetworkAccessManager *create(QObject *parent);
};
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+ QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+ QNetworkConfigurationManager manager;
+ if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+ // Get saved network configuration
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+ settings.endGroup();
+
+ // If the saved network configuration is not currently discovered use the system default
+ QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+ if ((config.state() & QNetworkConfiguration::Discovered) !=
+ QNetworkConfiguration::Discovered) {
+ config = manager.defaultConfiguration();
+ }
+
+ accessManager->setConfiguration(config);
+ }
+
+ return accessManager;
+}
int main(int argc, char *argv[])
{
QApplication application(argc, argv);
+ NetworkAccessManagerFactory networkAccessManagerFactory;
+
const QString mainQmlApp = QLatin1String("twitter.qml");
- QmlAppView view;
+ QDeclarativeView view;
+ view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
view.setSource(QUrl(mainQmlApp));
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
return application.exec();
}
-#if defined(Q_OS_SYMBIAN)
-#include "qmltwitter.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmltwitter/qmltwitter.pro b/demos/embedded/qmltwitter/qmltwitter.pro
index 7f9be57..7bd4617 100644
--- a/demos/embedded/qmltwitter/qmltwitter.pro
+++ b/demos/embedded/qmltwitter/qmltwitter.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
symbian {
TARGET.UID3 = 0x$$qmltwitter_uid3 # defined in deployment.pri
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/raycasting/raycasting.cpp b/demos/embedded/raycasting/raycasting.cpp
index 75ba147..21aa2c3 100644
--- a/demos/embedded/raycasting/raycasting.cpp
+++ b/demos/embedded/raycasting/raycasting.cpp
@@ -142,7 +142,7 @@ public:
qreal dv = -2 * cosa / bufw;
for (int ray = 0; ray < bufw; ++ray, u += du, v += dv) {
- // everytime this ray advances 'u' units in x direction,
+ // every time this ray advances 'u' units in x direction,
// it also advanced 'v' units in y direction
qreal uu = (u < 0) ? -u : u;
qreal vv = (v < 0) ? -v : v;
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index b352e3d..802d77d 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -81,7 +81,6 @@ bool Colors::noRescale = false;
bool Colors::noAnimations = false;
bool Colors::noBlending = false;
bool Colors::noScreenSync = false;
-bool Colors::noBlur = true;
bool Colors::fullscreen = false;
bool Colors::usePixmaps = false;
bool Colors::useLoop = false;
@@ -233,8 +232,6 @@ void Colors::parseArgs(int argc, char *argv[])
Colors::showFps = true;
else if (s == "-no-blending")
Colors::noBlending = true;
- else if (s == "-use-blur")
- Colors::noBlur = false;
else if (s == "-no-sync")
Colors::noScreenSync = true;
else if (s.startsWith("-menu"))
@@ -270,7 +267,7 @@ void Colors::parseArgs(int argc, char *argv[])
else if (s.startsWith("-h") || s.startsWith("-help")){
QMessageBox::warning(0, "Arguments",
QString("Usage: qtdemo [-verbose] [-no-adapt] [-opengl] [-software] [-fullscreen] [-ticker[0|1]] ")
- + "[-animations[0|1]] [-no-blending] [-use-blur] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] "
+ + "[-animations[0|1]] [-no-blending] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] "
+ "[-use-window-mask] [-no-rescale] "
+ "[-use-pixmaps] [-show-fps] [-show-br] [-8bit[0|1]] [-menu<int>] [-use-loop] [-use-balls] "
+ "[-animation-speed<float>] [-fps<int>] "
@@ -298,7 +295,6 @@ void Colors::setLowSettings()
Colors::usePixmaps = true;
Colors::noAnimations = true;
Colors::noBlending = true;
- Colors::noBlur = true;
}
void Colors::detectSystemResources()
diff --git a/demos/qtdemo/colors.h b/demos/qtdemo/colors.h
index 2d58058..1e0b795 100644
--- a/demos/qtdemo/colors.h
+++ b/demos/qtdemo/colors.h
@@ -91,7 +91,6 @@ public:
static bool noAnimations;
static bool noBlending;
static bool noScreenSync;
- static bool noBlur;
static bool useLoop;
static bool noWindowMask;
static bool usePixmaps;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 753014a..16c5bf3 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -310,14 +310,6 @@ void MainWindow::checkAdapt()
qDebug() << "- benchmark adaption: removed ticker (fps < 30)";
}
- //Note: Because we don't adapt later in the program, if blur makes FPS plummet then we won't catch it
- if (!Colors::noBlur && MenuManager::instance()->declarativeEngine && this->mainSceneRoot){
- Colors::noBlur = true;
- MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("useBlur", false);
- if (Colors::verbose)
- qDebug() << "- benchmark adaption: removed blur (fps < 30)";
- }
-
if (this->fpsMedian < 20){
Colors::noAnimations = true;
if (Colors::verbose)
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index 15561ab..7168b57 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -378,17 +378,6 @@ void MenuManager::launchQmlExample(const QString &name)
return;
}
}
- if(!Colors::noBlur){
- QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
- QPainter painter(&qmlBgImage);
- if(Colors::showFps)
- this->window->fpsLabel->setOpacity(0);
- this->window->render(&painter);
- if(Colors::showFps)
- this->window->fpsLabel->setOpacity(1.0);
- Qt::ImageConversionFlags convFlags = Qt::AvoidDither | Qt::NoOpaqueDetection;
- this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage, convFlags)));
- }
qmlRoot->setProperty("qmlFile", QVariant(""));//unload component
qmlRoot->setProperty("show", QVariant(true));
@@ -439,17 +428,8 @@ void MenuManager::init(MainWindow *window)
}
// Create QML Loader
- qmlRegisterType<QGraphicsBlurEffect>("Effects", 1, 0, "Blur");
- qmlRegisterType<QGraphicsDropShadowEffect>("Effects", 1, 0, "DropShadow");
declarativeEngine = new QDeclarativeEngine(this);
- // Note that we paint the background into a static image for a theorized performance improvement when blurring
- // It has not yet been determined what, if any, speed up this gives (but is left in 'cause the QML expects it now)
- declarativeEngine->rootContext()->setContextProperty("useBlur", !Colors::noBlur);
- QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
- qmlBgImage.fill(0);
- this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage)));
-
QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this);
qmlRoot = 0;
if(component.isReady())
diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index e15d33c..b5fdf39 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -40,26 +40,13 @@
****************************************************************************/
import Qt 4.7
-import Effects 1.0
-/* Vars exposed from C++
- pixmap bgAppPixmap
- bool useBlur (to turn on, pass -use-blur on the cmd line. Off by default 'cause it's too slow)
-*/
Item {
id: main
//height and width set by program to fill window
//below properties are sometimes set from C++
property url qmlFile: ''
property bool show: false
- Image{
- id: bg
- opacity: 0
- anchors.fill: parent
- z: -1
- pixmap: bgAppPixmap
- effect: Blur { id: blurEffect; enabled: useBlur; blurRadius: 8;}
- }
Item{ id:embeddedViewer
width: parent.width
@@ -112,13 +99,6 @@ Item {
anchors.fill:parent
}
- effect: DropShadow {
- enabled: useBlur;
- blurRadius: 9;
- color: "#88000000";
- xOffset:0
- yOffset:0
- }
}
Text{
@@ -136,6 +116,32 @@ Item {
onLinkActivated: Qt.openUrlExternally(link);
}
}
+ Rectangle{
+ id: helpLabel
+ property bool timedOut: false
+ z: 9
+ //Positioned in the top left corner
+ x: 8
+ y: 8
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ width: helpText.width + 16
+ height: helpText.height + 8
+ Text{
+ id: helpText
+ color: "black"
+ anchors.centerIn: parent
+ text: "Click outside the example to exit it."
+ }
+ opacity: 0
+ Behavior on opacity{ NumberAnimation{duration:500} }
+ Timer{
+ id: helpTimer
+ interval: 5000
+ onTriggered: {helpLabel.timedOut=true}
+ }
+ }
Rectangle{ id: blackout //Maybe use a colorize effect instead?
z: 8
anchors.fill: parent
@@ -160,8 +166,8 @@ Item {
opacity: 1
}
PropertyChanges {
- target: bg
- opacity: 1
+ target: helpLabel
+ opacity: helpLabel.timedOut?0:1
}
PropertyChanges {
target: blackout
@@ -171,9 +177,9 @@ Item {
]
transitions: [//Should not be too long, because the component has already started running
Transition { from: ''; to: "show"; reversible: true
- SequentialAnimation{
- PropertyAction { target: bg; property: useBlur?"y":"opacity";}//fade in blurred background only if blurred
- NumberAnimation{ properties: "opacity"; easing.type: Easing.InQuad; duration: 500}
+ ParallelAnimation{
+ ScriptAction{ script: {helpLabel.timedOut = false; helpTimer.restart();} }
+ NumberAnimation{ exclude: helpLabel; properties: "opacity"; easing.type: Easing.InQuad; duration: 500}
PropertyAction { target: loader; property: "focus"; value: true}//Might be needed to ensure the focus stays with us
}
}