summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-05 08:09:00 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-05 08:09:00 (GMT)
commitbb587db95d7c20344c0bf06a1f080c0a2e4a9250 (patch)
tree50c4615c0c5908bb5a26c1a3ee121dd1f7f070be /examples
parentf26f5b230e614faecce33cf52af0a0d62dcaddaa (diff)
parent555018baf3115cb2587d2217bf1a5b8f49564ad2 (diff)
downloadQt-bb587db95d7c20344c0bf06a1f080c0a2e4a9250.zip
Qt-bb587db95d7c20344c0bf06a1f080c0a2e4a9250.tar.gz
Qt-bb587db95d7c20344c0bf06a1f080c0a2e4a9250.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'examples')
-rw-r--r--examples/animation/sub-attaq/mainwindow.cpp2
-rw-r--r--examples/dialogs/sipdialog/dialog.cpp13
-rw-r--r--examples/dialogs/sipdialog/main.cpp2
-rw-r--r--examples/network/http/httpwindow.cpp4
-rw-r--r--examples/opengl/hellogl_es2/glwidget.cpp8
-rw-r--r--examples/richtext/textobject/textobject.pro4
-rw-r--r--examples/statemachine/eventtransitions/main.cpp5
-rw-r--r--examples/statemachine/factorial/main.cpp6
-rw-r--r--examples/statemachine/pingpong/main.cpp5
-rw-r--r--examples/statemachine/trafficlight/main.cpp5
-rw-r--r--examples/statemachine/twowaybutton/main.cpp4
11 files changed, 19 insertions, 39 deletions
diff --git a/examples/animation/sub-attaq/mainwindow.cpp b/examples/animation/sub-attaq/mainwindow.cpp
index 5e8e259..123363b 100644
--- a/examples/animation/sub-attaq/mainwindow.cpp
+++ b/examples/animation/sub-attaq/mainwindow.cpp
@@ -44,6 +44,8 @@
#include "graphicsscene.h"
//Qt
+#include <QGraphicsView>
+
#ifdef QT_NO_OPENGL
#include <QtGui/QMenuBar>
#include <QtGui/QLayout>
diff --git a/examples/dialogs/sipdialog/dialog.cpp b/examples/dialogs/sipdialog/dialog.cpp
index 9f1b9ad..653b518 100644
--- a/examples/dialogs/sipdialog/dialog.cpp
+++ b/examples/dialogs/sipdialog/dialog.cpp
@@ -90,7 +90,7 @@ Dialog::Dialog()
//! [Dialog constructor part4]
//! [Dialog constructor part5]
- connect(button, SIGNAL(pressed()),
+ connect(button, SIGNAL(clicked()),
qApp, SLOT(closeAllWindows()));
connect(QApplication::desktop(), SIGNAL(workAreaResized(int)),
this, SLOT(desktopResized(int)));
@@ -111,14 +111,13 @@ void Dialog::reactToSIP()
{
QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
- if (desktopGeometry.width() == availableGeometry.width()) {
- if (desktopGeometry.height() > availableGeometry.height()) {
+ if (desktopGeometry != availableGeometry) {
+ if (windowState() | Qt::WindowMaximized)
setWindowState(windowState() & ~Qt::WindowMaximized);
- setGeometry(availableGeometry);
- } else {
- setWindowState(windowState() | Qt::WindowMaximized);
- }
+
+ setGeometry(availableGeometry);
}
+
desktopGeometry = availableGeometry;
}
//! [reactToSIP() function]
diff --git a/examples/dialogs/sipdialog/main.cpp b/examples/dialogs/sipdialog/main.cpp
index 5fcbfd8..fec6de2 100644
--- a/examples/dialogs/sipdialog/main.cpp
+++ b/examples/dialogs/sipdialog/main.cpp
@@ -48,6 +48,6 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
- dialog.exec();
+ return dialog.exec();
}
//! [main() function]
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index ebde770..7aded07 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -116,8 +116,8 @@ void HttpWindow::downloadFile()
if (QMessageBox::question(this, tr("HTTP"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
- QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel)
- == QMessageBox::Cancel)
+ QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
+ == QMessageBox::No)
return;
QFile::remove(fileName);
}
diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp
index ee50670..cb4a48d 100644
--- a/examples/opengl/hellogl_es2/glwidget.cpp
+++ b/examples/opengl/hellogl_es2/glwidget.cpp
@@ -190,7 +190,7 @@ void GLWidget::initializeGL ()
" color = clamp(color, 0.0, 1.0);\n"
" gl_Position = matrix * vertex;\n"
"}\n";
- vshader1->setSourceCode(vsrc1);
+ vshader1->compile(vsrc1);
QGLShader *fshader1 = new QGLShader(QGLShader::FragmentShader, this);
const char *fsrc1 =
@@ -199,7 +199,7 @@ void GLWidget::initializeGL ()
"{\n"
" gl_FragColor = color;\n"
"}\n";
- fshader1->setSourceCode(fsrc1);
+ fshader1->compile(fsrc1);
program1.addShader(vshader1);
program1.addShader(fshader1);
@@ -224,7 +224,7 @@ void GLWidget::initializeGL ()
" gl_Position = matrix * vertex;\n"
" texc = texCoord;\n"
"}\n";
- vshader2->setSourceCode(vsrc2);
+ vshader2->compile(vsrc2);
QGLShader *fshader2 = new QGLShader(QGLShader::FragmentShader);
const char *fsrc2 =
@@ -237,7 +237,7 @@ void GLWidget::initializeGL ()
" color = color * 0.2 + color * 0.8 * angle;\n"
" gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);\n"
"}\n";
- fshader2->setSourceCode(fsrc2);
+ fshader2->compile(fsrc2);
program2.addShader(vshader2);
program2.addShader(fshader2);
diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro
index fbb809c..4fa9cb0 100644
--- a/examples/richtext/textobject/textobject.pro
+++ b/examples/richtext/textobject/textobject.pro
@@ -12,3 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject
INSTALLS += target sources
+filesToDeploy.sources = files/*.svg
+filesToDeploy.path = files
+DEPLOYMENT += filesToDeploy
+
diff --git a/examples/statemachine/eventtransitions/main.cpp b/examples/statemachine/eventtransitions/main.cpp
index aba0c73..5959016 100644
--- a/examples/statemachine/eventtransitions/main.cpp
+++ b/examples/statemachine/eventtransitions/main.cpp
@@ -40,11 +40,6 @@
****************************************************************************/
#include <QtGui>
-#ifdef QT_STATEMACHINE_SOLUTION
-#include <qstatemachine.h>
-#include <qstate.h>
-#include <qeventtransition.h>
-#endif
//! [0]
class Window : public QWidget
diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp
index 1065eb8..bf3f80e 100644
--- a/examples/statemachine/factorial/main.cpp
+++ b/examples/statemachine/factorial/main.cpp
@@ -41,12 +41,6 @@
#include <QtCore>
#include <stdio.h>
-#ifdef QT_STATEMACHINE_SOLUTION
-#include <qstatemachine.h>
-#include <qstate.h>
-#include <qsignaltransition.h>
-#include <qfinalstate.h>
-#endif
//! [0]
class Factorial : public QObject
diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp
index 331627e..586b422 100644
--- a/examples/statemachine/pingpong/main.cpp
+++ b/examples/statemachine/pingpong/main.cpp
@@ -41,11 +41,6 @@
#include <QtCore>
#include <stdio.h>
-#ifdef QT_STATEMACHINE_SOLUTION
-#include <qstate.h>
-#include <qstatemachine.h>
-#include <qabstracttransition.h>
-#endif
//! [0]
class PingEvent : public QEvent
diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp
index 8a46fff..23f4bed 100644
--- a/examples/statemachine/trafficlight/main.cpp
+++ b/examples/statemachine/trafficlight/main.cpp
@@ -40,11 +40,6 @@
****************************************************************************/
#include <QtGui>
-#ifdef QT_STATEMACHINE_SOLUTION
-#include <qstate.h>
-#include <qstatemachine.h>
-#include <qfinalstate.h>
-#endif
//! [0]
class LightWidget : public QWidget
diff --git a/examples/statemachine/twowaybutton/main.cpp b/examples/statemachine/twowaybutton/main.cpp
index a2c6e45..f5afeca 100644
--- a/examples/statemachine/twowaybutton/main.cpp
+++ b/examples/statemachine/twowaybutton/main.cpp
@@ -40,10 +40,6 @@
****************************************************************************/
#include <QtGui>
-#ifdef QT_STATEMACHINE_SOLUTION
-#include <qstate.h>
-#include <qstatemachine.h>
-#endif
//! [0]
int main(int argc, char **argv)