summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-06-17 06:39:00 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-06-17 06:39:00 (GMT)
commit3bb2e76cc9c14eb1733c0c9cf6fdc5a7f91fa1bf (patch)
treeacaedb05da82cc66d4b479970f93e0665779b8fb /demos
parentfae073096e027bbf079efac7fdd8e3f34ba0a4ab (diff)
parent00d6d725ed0c3eb7d2bc0d0187e66c0ee55ef4a7 (diff)
downloadQt-3bb2e76cc9c14eb1733c0c9cf6fdc5a7f91fa1bf.zip
Qt-3bb2e76cc9c14eb1733c0c9cf6fdc5a7f91fa1bf.tar.gz
Qt-3bb2e76cc9c14eb1733c0c9cf6fdc5a7f91fa1bf.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos')
-rw-r--r--demos/boxes/glbuffers.h2
-rw-r--r--demos/boxes/scene.cpp2
-rw-r--r--demos/boxes/scene.h3
-rw-r--r--demos/declarative/flickr/content/Loading.qml2
-rw-r--r--demos/declarative/flickr/content/Progress.qml14
-rw-r--r--demos/declarative/flickr/content/Slider.qml15
-rw-r--r--demos/declarative/flickr/flickr.qml2
-rw-r--r--demos/declarative/flickr/flickr2.qml2
-rw-r--r--demos/embeddeddialogs/main.cpp1
-rw-r--r--demos/qtdemo/colors.cpp2
-rw-r--r--demos/qtdemo/mainwindow.cpp13
-rw-r--r--demos/qtdemo/xml/examples.xml15
-rw-r--r--demos/spreadsheet/spreadsheetdelegate.cpp6
13 files changed, 52 insertions, 27 deletions
diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h
index 392924e..9e05fad 100644
--- a/demos/boxes/glbuffers.h
+++ b/demos/boxes/glbuffers.h
@@ -58,7 +58,9 @@ if (m_failed || !(assertion)) {
returnStatement; \
}
+QT_BEGIN_NAMESPACE
class QMatrix4x4;
+QT_END_NAMESPACE
class GLTexture
{
diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp
index e2aa16b..2376782 100644
--- a/demos/boxes/scene.cpp
+++ b/demos/boxes/scene.cpp
@@ -559,7 +559,7 @@ void Scene::initGL()
<< ":/res/boxes/cubemap_negy.jpg" << ":/res/boxes/cubemap_posz.jpg" << ":/res/boxes/cubemap_negz.jpg";
m_environment = new GLTextureCube(list, qMin(1024, m_maxTextureSize));
m_environmentShader = new QGLShader(QGLShader::FragmentShader);
- m_environmentShader->setSourceCode(environmentShaderText);
+ m_environmentShader->compile(environmentShaderText);
m_environmentProgram = new QGLShaderProgram;
m_environmentProgram->addShader(m_vertexShader);
m_environmentProgram->addShader(m_environmentShader);
diff --git a/demos/boxes/scene.h b/demos/boxes/scene.h
index 48ecaba..9f8d2af 100644
--- a/demos/boxes/scene.h
+++ b/demos/boxes/scene.h
@@ -56,7 +56,10 @@
#define PI 3.14159265358979
+QT_BEGIN_NAMESPACE
class QMatrix4x4;
+QT_END_NAMESPACE
+
class ParameterEdit : public QWidget
{
public:
diff --git a/demos/declarative/flickr/content/Loading.qml b/demos/declarative/flickr/content/Loading.qml
index cf27e38..7488a66 100644
--- a/demos/declarative/flickr/content/Loading.qml
+++ b/demos/declarative/flickr/content/Loading.qml
@@ -1,6 +1,6 @@
Image {
id: Loading; source: "pics/loading.png"; transformOrigin: "Center"
rotation: NumericAnimation {
- id: "RotationAnimation"; from: 0; to: 360; running:true; repeat: true; duration: 900
+ id: "RotationAnimation"; from: 0; to: 360; running: Loading.visible == true; repeat: true; duration: 900
}
}
diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml
index aa2a2e6..743c45e 100644
--- a/demos/declarative/flickr/content/Progress.qml
+++ b/demos/declarative/flickr/content/Progress.qml
@@ -4,8 +4,12 @@ Item {
property var progress: 0
Rect {
- id: Container; anchors.fill: parent; gradientColor: "#66000000";
- pen.color: "white"; pen.width: 0; color: "#66343434"; radius: height/2 - 2
+ id: Container; anchors.fill: parent
+ pen.color: "white"; pen.width: 0; radius: height/2 - 2
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
}
Rect {
@@ -13,7 +17,11 @@ Item {
y: 2; height: parent.height-4;
x: 2; width: Math.max(parent.width * progress - 4, 0);
opacity: width < 1 ? 0 : 1
- color: "lightsteelblue"; gradientColor: "steelblue"; radius: height/2 - 2
+ gradient: Gradient {
+ GradientStop { position: 0; color: "lightsteelblue" }
+ GradientStop { position: 1.0; color: "steelblue" }
+ }
+ radius: height/2 - 2
}
Text {
diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml
index aae4631..931dfe3 100644
--- a/demos/declarative/flickr/content/Slider.qml
+++ b/demos/declarative/flickr/content/Slider.qml
@@ -9,14 +9,21 @@ Item {
property int xMax: Slider.width - Handle.width - 4
Rect {
- id: Container; anchors.fill: parent; gradientColor: "#66000000";
- pen.color: "white"; pen.width: 0; color: "#66343434"; radius: 8
+ id: Container; anchors.fill: parent
+ pen.color: "white"; pen.width: 0; radius: 8
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
}
Rect {
id: Handle
- x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: Slider.height-4
- color: "lightgray"; gradientColor: "gray"; radius: 6
+ x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: Slider.height-4; radius: 6
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightgray" }
+ GradientStop { position: 1.0; color: "gray" }
+ }
MouseRegion {
anchors.fill: parent; drag.target: parent
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index da77d93..83448ee 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -16,7 +16,7 @@ Item {
Role { name: "title"; query: "title/string()" }
Role { name: "imagePath"; query: "media:thumbnail/@url/string()" }
Role { name: "url"; query: "media:content/@url/string()" }
- Role { name: "description"; query: "description/string()"; isCData: true }
+ Role { name: "description"; query: "description/string()" }
Role { name: "tags"; query: "media:category/string()" }
Role { name: "photoWidth"; query: "media:content/@width/string()" }
Role { name: "photoHeight"; query: "media:content/@height/string()" }
diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml
index 52f8675..79f7a32 100644
--- a/demos/declarative/flickr/flickr2.qml
+++ b/demos/declarative/flickr/flickr2.qml
@@ -18,7 +18,7 @@ Item {
Role { name: "title"; query: "title/string()" }
Role { name: "imagePath"; query: "media:thumbnail/@url/string()" }
Role { name: "url"; query: "media:content/@url/string()" }
- Role { name: "description"; query: "description/string()"; isCData: true }
+ Role { name: "description"; query: "description/string()" }
Role { name: "tags"; query: "media:category/string()" }
Role { name: "photoWidth"; query: "media:content/@width/string()" }
Role { name: "photoHeight"; query: "media:content/@height/string()" }
diff --git a/demos/embeddeddialogs/main.cpp b/demos/embeddeddialogs/main.cpp
index cfb31c4..c9b6ee1 100644
--- a/demos/embeddeddialogs/main.cpp
+++ b/demos/embeddeddialogs/main.cpp
@@ -76,7 +76,6 @@ int main(int argc, char *argv[])
view.scale(0.5, 0.5);
view.setRenderHints(view.renderHints() | QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
view.setBackgroundBrush(QPixmap(":/No-Ones-Laughing-3.jpg"));
- view.setCacheMode(QGraphicsView::CacheBackground);
view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
view.show();
view.setWindowTitle("Embedded Dialogs Demo");
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index 733b285..b82de2f 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -95,7 +95,7 @@ bool Colors::noTickerMorph = false;
bool Colors::adapted = false;
bool Colors::verbose = false;
bool Colors::pause = true;
-int Colors::fps = 100;
+int Colors::fps = 60;
int Colors::menuCount = 18;
float Colors::animSpeed = 1.0;
float Colors::animSpeedButtons = 1.0;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 0da69b2..858d389 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -185,7 +185,6 @@ void MainWindow::switchTimerOnOff(bool on)
if (on && !Colors::noTimerUpdate){
this->useTimer = true;
- this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
this->fpsTime = QTime::currentTime();
this->updateTimer.start(int(1000 / Colors::fps));
}
@@ -257,10 +256,6 @@ void MainWindow::tick()
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->tick();
- this->viewport()->update();
- if (Colors::softwareRendering)
- QApplication::syncX();
-
if (this->useTimer)
this->updateTimer.start(int(1000 / Colors::fps));
}
@@ -428,9 +423,7 @@ void MainWindow::focusInEvent(QFocusEvent *)
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->pause(false);
- int code = MenuManager::instance()->currentMenuCode;
- if (code == MenuManager::ROOT || code == MenuManager::MENU1)
- this->switchTimerOnOff(true);
+ this->switchTimerOnOff(true);
this->pausedLabel->setRecursiveVisible(false);
}
@@ -443,9 +436,7 @@ void MainWindow::focusOutEvent(QFocusEvent *)
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->pause(true);
- int code = MenuManager::instance()->currentMenuCode;
- if (code == MenuManager::ROOT || code == MenuManager::MENU1)
- this->switchTimerOnOff(false);
+ this->switchTimerOnOff(false);
this->pausedLabel->setRecursiveVisible(true);
}
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 96a3e80..2560848 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -19,6 +19,15 @@
<example filename="mediaplayer" name="Media Player" />
<example filename="boxes" name="Boxes" />
</demos>
+ <category dirname="animation" name="Animation Framework">
+ <example filename="animatedtiles" name="Animated Tiles" />
+ <example filename="appchooser" name="Appchooser" />
+ <example filename="easing" name="Easing Curves" />
+ <example filename="moveblocks" name="Moving Blocks" />
+ <example filename="states" name="UI States" />
+ <example filename="stickman" name="Stickman" />
+ <example filename="sub-attaq" name="Sub-attaq" />
+ </category>
<category dirname="qtconcurrent" name="Concurrent Programming">
<example filename="map" name="Map" executable="false" />
<example filename="progressdialog" name="Progress Dialog" />
@@ -167,6 +176,12 @@
<example filename="masterdetail" name="Music Archive" />
<example filename="sqlwidgetmapper" name="SQL Widget Mapper" />
</category>
+ <category dirname="statemachine" name="State Machine">
+ <example filename="eventtransitions" name="Event Transitions" />
+ <example filename="tankgame" name="Tank Game" />
+ <example filename="trafficlight" name="Traffic Light" />
+ <example filename="twowaybutton" name="Two-way Button" />
+ </category>
<category dirname="threads" name="Threading">
<example filename="mandelbrot" name="Mandelbrot" />
</category>
diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp
index 465c92f..2916757 100644
--- a/demos/spreadsheet/spreadsheetdelegate.cpp
+++ b/demos/spreadsheet/spreadsheetdelegate.cpp
@@ -51,7 +51,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent,
{
if (index.column() == 1) {
QDateTimeEdit *editor = new QDateTimeEdit(parent);
- editor->setDisplayFormat("dd/M/yyy");
+ editor->setDisplayFormat("dd/M/yyyy");
editor->setCalendarPopup(true);
return editor;
}
@@ -93,7 +93,7 @@ void SpreadSheetDelegate::setEditorData(QWidget *editor,
if (dateEditor) {
dateEditor->setDate(QDate::fromString(
index.model()->data(index, Qt::EditRole).toString(),
- "d/M/yy"));
+ "d/M/yyyy"));
}
}
}
@@ -107,7 +107,7 @@ void SpreadSheetDelegate::setModelData(QWidget *editor,
} else {
QDateTimeEdit *dateEditor = qobject_cast<QDateTimeEdit *>(editor);
if (dateEditor) {
- model->setData(index, dateEditor->date().toString("dd/M/yyy"));
+ model->setData(index, dateEditor->date().toString("dd/M/yyyy"));
}
}
}