summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-05 07:26:24 +0100
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-05 07:26:24 +0100
commitee88b2d8408396188eb2ce52d740c395c6cd4656 (patch)
tree1f59ea0612fecbaca595594d3812dd2aab64cf63 /examples
parent673973acc20ce4e068d63fa5b0391f5c785be8a3 (diff)
parentaa58293b57a05cd52b36ba14a05958dceb65c603 (diff)
Merge remote branch 'qt-official/4.6' into 4.6
Diffstat (limited to 'examples')
-rw-r--r--examples/animation/stickman/lifecycle.cpp4
-rw-r--r--examples/mainwindows/mdi/mainwindow.cpp2
-rw-r--r--examples/mainwindows/sdi/mainwindow.h2
-rw-r--r--examples/multimedia/videographicsitem/videoitem.cpp4
-rw-r--r--examples/multimedia/videographicsitem/videoplayer.cpp3
-rw-r--r--examples/multimedia/videowidget/videoplayer.cpp3
-rw-r--r--examples/multimedia/videowidget/videowidget.cpp2
-rw-r--r--examples/multimedia/videowidget/videowidgetsurface.cpp4
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.pro9
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.pro6
-rw-r--r--examples/script/customclass/bytearrayclass.cpp17
11 files changed, 15 insertions, 41 deletions
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index 250fb85b63..1b6f9cd7c3 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -194,14 +194,14 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa
topLevel->setInitialState(frameState);
else
//! [2]
- previousState->addTransition(previousState, SIGNAL(polished()), frameState);
+ previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), frameState);
//! [2]
previousState = frameState;
}
// Loop
- previousState->addTransition(previousState, SIGNAL(polished()), topLevel->initialState());
+ previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), topLevel->initialState());
return topLevel;
diff --git a/examples/mainwindows/mdi/mainwindow.cpp b/examples/mainwindows/mdi/mainwindow.cpp
index 712d91f884..edb33b7a40 100644
--- a/examples/mainwindows/mdi/mainwindow.cpp
+++ b/examples/mainwindows/mdi/mainwindow.cpp
@@ -71,7 +71,7 @@ MainWindow::MainWindow()
void MainWindow::closeEvent(QCloseEvent *event)
{
mdiArea->closeAllSubWindows();
- if (activeMdiChild()) {
+ if (mdiArea->currentSubWindow()) {
event->ignore();
} else {
writeSettings();
diff --git a/examples/mainwindows/sdi/mainwindow.h b/examples/mainwindows/sdi/mainwindow.h
index ca478dfc5b..a925e2f8de 100644
--- a/examples/mainwindows/sdi/mainwindow.h
+++ b/examples/mainwindows/sdi/mainwindow.h
@@ -50,12 +50,14 @@ class QMenu;
class QTextEdit;
QT_END_NAMESPACE
+//! [class definition with macro]
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
+//! [class definition with macro]
MainWindow(const QString &fileName);
protected:
diff --git a/examples/multimedia/videographicsitem/videoitem.cpp b/examples/multimedia/videographicsitem/videoitem.cpp
index c95e33591b..99e8df82aa 100644
--- a/examples/multimedia/videographicsitem/videoitem.cpp
+++ b/examples/multimedia/videographicsitem/videoitem.cpp
@@ -104,7 +104,7 @@ QList<QVideoFrame::PixelFormat> VideoItem::supportedPixelFormats(
bool VideoItem::start(const QVideoSurfaceFormat &format)
{
if (isFormatSupported(format)) {
- imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat());
+ imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
imageSize = format.frameSize();
framePainted = true;
@@ -129,7 +129,7 @@ void VideoItem::stop()
bool VideoItem::present(const QVideoFrame &frame)
{
if (!framePainted) {
- if (!isStarted())
+ if (!QAbstractVideoSurface::isActive())
setError(StoppedError);
return false;
diff --git a/examples/multimedia/videographicsitem/videoplayer.cpp b/examples/multimedia/videographicsitem/videoplayer.cpp
index 83644db7d5..9ac4152df3 100644
--- a/examples/multimedia/videographicsitem/videoplayer.cpp
+++ b/examples/multimedia/videographicsitem/videoplayer.cpp
@@ -119,8 +119,7 @@ void VideoPlayer::openFile()
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"));
if (!fileName.isEmpty()) {
- if (videoItem->isStarted())
- videoItem->stop();
+ videoItem->stop();
movie.setFileName(fileName);
diff --git a/examples/multimedia/videowidget/videoplayer.cpp b/examples/multimedia/videowidget/videoplayer.cpp
index ed24714994..cd146e8f2b 100644
--- a/examples/multimedia/videowidget/videoplayer.cpp
+++ b/examples/multimedia/videowidget/videoplayer.cpp
@@ -100,8 +100,7 @@ void VideoPlayer::openFile()
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"));
if (!fileName.isEmpty()) {
- if (surface->isStarted())
- surface->stop();
+ surface->stop();
movie.setFileName(fileName);
diff --git a/examples/multimedia/videowidget/videowidget.cpp b/examples/multimedia/videowidget/videowidget.cpp
index 80688e1998..f73a52f23b 100644
--- a/examples/multimedia/videowidget/videowidget.cpp
+++ b/examples/multimedia/videowidget/videowidget.cpp
@@ -84,7 +84,7 @@ void VideoWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
- if (surface->isStarted()) {
+ if (surface->isActive()) {
const QRect videoRect = surface->videoRect();
if (!videoRect.contains(event->rect())) {
diff --git a/examples/multimedia/videowidget/videowidgetsurface.cpp b/examples/multimedia/videowidget/videowidgetsurface.cpp
index ec9b8b5600..b69375c11b 100644
--- a/examples/multimedia/videowidget/videowidgetsurface.cpp
+++ b/examples/multimedia/videowidget/videowidgetsurface.cpp
@@ -73,7 +73,7 @@ bool VideoWidgetSurface::isFormatSupported(
{
Q_UNUSED(similar);
- const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat());
+ const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
const QSize size = format.frameSize();
return imageFormat != QImage::Format_Invalid
@@ -85,7 +85,7 @@ bool VideoWidgetSurface::isFormatSupported(
//! [2]
bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format)
{
- const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat());
+ const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
const QSize size = format.frameSize();
if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro
index 3168743415..80ef7df315 100644
--- a/examples/opengl/hellogl_es/hellogl_es.pro
+++ b/examples/opengl/hellogl_es/hellogl_es.pro
@@ -20,15 +20,6 @@ HEADERS += bubble.h
RESOURCES += texture.qrc
QT += opengl
-wince*:{
- contains(QT_CONFIG,opengles1) {
- QMAKE_LIBS += "libGLES_CM.lib"
- }
- contains(QT_CONFIG,opengles1cl) {
- QMAKE_LIBS += "libGLES_CL.lib"
- }
-}
-
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro
index d5ad4b81ec..92b42248de 100644
--- a/examples/opengl/hellogl_es2/hellogl_es2.pro
+++ b/examples/opengl/hellogl_es2/hellogl_es2.pro
@@ -25,9 +25,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
INSTALLS += target sources
-
-
-wince*: {
- QMAKE_LIBS += "libGLESv2.lib"
-
-} \ No newline at end of file
diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp
index 7291b9769b..bce69e4da7 100644
--- a/examples/script/customclass/bytearrayclass.cpp
+++ b/examples/script/customclass/bytearrayclass.cpp
@@ -72,18 +72,6 @@ private:
int m_last;
};
-static qint32 toArrayIndex(const QString &str)
-{
- QByteArray bytes = str.toUtf8();
- char *eptr;
- quint32 pos = strtoul(bytes.constData(), &eptr, 10);
- if ((eptr == bytes.constData() + bytes.size())
- && (QByteArray::number(pos) == bytes)) {
- return pos;
- }
- return -1;
-}
-
//! [0]
ByteArrayClass::ByteArrayClass(QScriptEngine *engine)
: QObject(engine), QScriptClass(engine)
@@ -120,8 +108,9 @@ QScriptClass::QueryFlags ByteArrayClass::queryProperty(const QScriptValue &objec
if (name == length) {
return flags;
} else {
- qint32 pos = toArrayIndex(name);
- if (pos == -1)
+ bool isArrayIndex;
+ qint32 pos = name.toArrayIndex(&isArrayIndex);
+ if (!isArrayIndex)
return 0;
*id = pos;
if ((flags & HandlesReadAccess) && (pos >= ba->size()))