summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h32
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview.cpp29
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview_p.h7
-rw-r--r--src/declarative/util/qmlanimation_p_p.h32
-rw-r--r--src/declarative/util/qmlbind.cpp14
-rw-r--r--src/declarative/util/qmlbind_p.h7
-rw-r--r--src/declarative/util/qmlpackage.cpp2
-rw-r--r--src/declarative/util/qmltransitionmanager.cpp6
8 files changed, 89 insertions, 40 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h b/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h
index cb914d6..c4bbbe4 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
index da6c00d..e165e59 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
@@ -1192,6 +1192,35 @@ QmlGraphicsWebPage::~QmlGraphicsWebPage()
{
}
+void QmlGraphicsWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
+{
+ qWarning() << sourceID << ":" << lineNumber << ":" << message;
+}
+
+QString QmlGraphicsWebPage::chooseFile(QWebFrame *originatingFrame, const QString& oldFile)
+{
+ // Not supported (it's modal)
+ return oldFile;
+}
+
+void QmlGraphicsWebPage::javaScriptAlert(QWebFrame *originatingFrame, const QString& msg)
+{
+ emit viewItem()->alert(msg);
+}
+
+bool QmlGraphicsWebPage::javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg)
+{
+ // Not supported (it's modal)
+ return false;
+}
+
+bool QmlGraphicsWebPage::javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result)
+{
+ // Not supported (it's modal)
+ return false;
+}
+
+
/*
Qt WebKit does not understand non-QWidget plugins, so dummy widgets
are created, parented to a single dummy tool window.
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview_p.h b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
index e2e4888..fa7d19d 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
@@ -69,6 +69,11 @@ public:
protected:
QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
QWebPage *createWindow(WebWindowType type);
+ void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID);
+ QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
+ void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
+ bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
+ bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result);
private:
QmlGraphicsWebView *viewItem();
@@ -195,6 +200,8 @@ Q_SIGNALS:
void zoomTo(qreal zoom, int centerX, int centerY);
+ void alert(const QString& message);
+
public Q_SLOTS:
QVariant evaluateJavaScript(const QString&);
diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h
index 27c0cd7..cb1c642 100644
--- a/src/declarative/util/qmlanimation_p_p.h
+++ b/src/declarative/util/qmlanimation_p_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp
index b8ab53e..2f692d8 100644
--- a/src/declarative/util/qmlbind.cpp
+++ b/src/declarative/util/qmlbind.cpp
@@ -55,9 +55,10 @@ QT_BEGIN_NAMESPACE
class QmlBindPrivate : public QObjectPrivate
{
public:
- QmlBindPrivate() : when(true), obj(0) {}
+ QmlBindPrivate() : when(true), componentComplete(false), obj(0) {}
- bool when;
+ bool when : 1;
+ bool componentComplete : 1;
QObject *obj;
QString prop;
QmlNullableValue<QVariant> value;
@@ -176,10 +177,17 @@ void QmlBind::setValue(const QVariant &v)
eval();
}
+void QmlBind::componentComplete()
+{
+ Q_D(QmlBind);
+ d->componentComplete = true;
+ eval();
+}
+
void QmlBind::eval()
{
Q_D(QmlBind);
- if (!d->obj || d->value.isNull || !d->when)
+ if (!d->obj || d->value.isNull || !d->when || !d->componentComplete)
return;
QmlMetaProperty prop(d->obj, d->prop);
diff --git a/src/declarative/util/qmlbind_p.h b/src/declarative/util/qmlbind_p.h
index a9b7b98..4d85698 100644
--- a/src/declarative/util/qmlbind_p.h
+++ b/src/declarative/util/qmlbind_p.h
@@ -52,11 +52,11 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QmlBindPrivate;
-class Q_DECLARATIVE_EXPORT QmlBind : public QObject
+class Q_DECLARATIVE_EXPORT QmlBind : public QObject, public QmlParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QmlBind)
-
+ Q_INTERFACES(QmlParserStatus)
Q_PROPERTY(QObject *target READ object WRITE setObject)
Q_PROPERTY(QString property READ property WRITE setProperty)
Q_PROPERTY(QVariant value READ value WRITE setValue)
@@ -78,6 +78,9 @@ public:
QVariant value() const;
void setValue(const QVariant &);
+protected:
+ virtual void componentComplete();
+
private:
void eval();
};
diff --git a/src/declarative/util/qmlpackage.cpp b/src/declarative/util/qmlpackage.cpp
index 908b368..6bc1ef9 100644
--- a/src/declarative/util/qmlpackage.cpp
+++ b/src/declarative/util/qmlpackage.cpp
@@ -101,7 +101,7 @@ QmlPackage::~QmlPackage()
Q_D(QmlPackage);
for (int ii = 0; ii < d->dataList.count(); ++ii) {
QObject *obj = d->dataList.at(ii);
- delete obj;
+ obj->setParent(this);
}
}
diff --git a/src/declarative/util/qmltransitionmanager.cpp b/src/declarative/util/qmltransitionmanager.cpp
index d1db9ec..ba726db 100644
--- a/src/declarative/util/qmltransitionmanager.cpp
+++ b/src/declarative/util/qmltransitionmanager.cpp
@@ -236,8 +236,11 @@ void QmlTransitionManager::transition(const QList<Action> &list,
action.property.write(action.toValue);
}
}
- if (!transition)
+ if (!transition) {
d->applyBindings();
+ if (d->state)
+ static_cast<QmlStatePrivate*>(QObjectPrivate::get(d->state))->complete();
+ }
}
void QmlTransitionManager::cancel()
@@ -262,7 +265,6 @@ void QmlTransitionManager::cancel()
}
d->bindingsList.clear();
d->completeList.clear();
-
}
QT_END_NAMESPACE