summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp35
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstext.cpp19
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstext_p.h27
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp20
-rw-r--r--src/declarative/qml/qml.pri2
-rw-r--r--src/declarative/qml/qmlbindingoptimizations.cpp4
-rw-r--r--src/declarative/qml/qmlcompositetypemanager.cpp4
-rw-r--r--src/declarative/qml/qmlcontext.cpp4
-rw-r--r--src/declarative/qml/qmlcontext_p.h2
-rw-r--r--src/declarative/qml/qmlengine.cpp17
-rw-r--r--src/declarative/qml/qmlexpression.cpp7
-rw-r--r--src/declarative/qml/qmlmoduleplugin.cpp89
-rw-r--r--src/declarative/qml/qmlmoduleplugin.h78
-rw-r--r--src/declarative/qml/qmlvaluetype.cpp12
-rw-r--r--src/declarative/qml/qmlvmemetaobject.cpp1
15 files changed, 291 insertions, 30 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp b/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
index fa8aaeb..a5a7935 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
@@ -89,11 +89,40 @@ public:
provides a lot of important functionality, including anchors and proper
management of child items. GraphicsObjectContainer helps provide these
functions to other QGraphicsObjects, so that they can be used unaltered in
- a QML scene.
+ a QML scene. QGraphicsObjects, which are not QmlGraphicsItems, and which are
+ placed in a QML scene outside of a GraphicsObjectContainer, will not appear
+ on screen at all.
A GraphicsObjectContainer can have one element inside it, and it must be a
- QGraphicsObject or subclass. The graphics object inside the
- GraphicsObjectContainer can then be used normally.
+ QGraphicsObject or subclass which has been exposed to the QML engine.
+ The graphics object inside the GraphicsObjectContainer can then be used
+ like any other item in QML with the exception of not being reparentable
+ and not having the standard properties of QML items (such as anchors).
+
+ As the contained object is positioned relative to the container, anchors
+ affecting the container item will affect the onscreen position of the
+ contained item. If synchronizedResizing is set to true, then anchors
+ affecting the container item's size will also affect the contained item's
+ size.
+
+ Example:
+ \code
+ import Qt 4.6
+ import MyApp 2.1 as Widgets
+ Rectangle{
+ id: rect
+ property alias widgetPropertyThree: widget.myThirdProperty;
+ GraphicsObjectContainer{
+ synchronizedResizing: true
+ anchors.margins: 10
+ anchors.fill: parent
+ Widgets.MyWidget{
+ myProperty: "A Value"
+ myOtherProperty: rect.color
+ }
+ }
+ }
+ \endcode
*/
/*!
diff --git a/src/declarative/graphicsitems/qmlgraphicstext.cpp b/src/declarative/graphicsitems/qmlgraphicstext.cpp
index ce86b8f..854ef45 100644
--- a/src/declarative/graphicsitems/qmlgraphicstext.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstext.cpp
@@ -142,10 +142,14 @@ QFont QmlGraphicsText::font() const
void QmlGraphicsText::setFont(const QFont &font)
{
Q_D(QmlGraphicsText);
+ if (d->font == font)
+ return;
+
d->font = font;
d->updateLayout();
d->markImgDirty();
+ emit fontChanged(d->font);
}
void QmlGraphicsText::setText(const QString &n)
@@ -194,6 +198,7 @@ void QmlGraphicsText::setColor(const QColor &color)
d->color = color;
d->markImgDirty();
+ emit colorChanged(d->color);
}
/*!
@@ -248,6 +253,7 @@ void QmlGraphicsText::setStyle(QmlGraphicsText::TextStyle style)
d->style = style;
d->markImgDirty();
+ emit styleChanged(d->style);
}
void QmlGraphicsText::setStyleColor(const QColor &color)
@@ -258,6 +264,7 @@ void QmlGraphicsText::setStyleColor(const QColor &color)
d->styleColor = color;
d->markImgDirty();
+ emit styleColorChanged(d->styleColor);
}
/*!
@@ -295,7 +302,11 @@ QmlGraphicsText::HAlignment QmlGraphicsText::hAlign() const
void QmlGraphicsText::setHAlign(HAlignment align)
{
Q_D(QmlGraphicsText);
+ if (d->hAlign == align)
+ return;
+
d->hAlign = align;
+ emit horizontalAlignmentChanged(align);
}
QmlGraphicsText::VAlignment QmlGraphicsText::vAlign() const
@@ -307,7 +318,11 @@ QmlGraphicsText::VAlignment QmlGraphicsText::vAlign() const
void QmlGraphicsText::setVAlign(VAlignment align)
{
Q_D(QmlGraphicsText);
+ if (d->vAlign == align)
+ return;
+
d->vAlign = align;
+ emit verticalAlignmentChanged(align);
}
/*!
@@ -339,6 +354,7 @@ void QmlGraphicsText::setWrap(bool w)
d->updateLayout();
d->markImgDirty();
+ emit wrapChanged(d->wrap);
}
/*!
@@ -405,6 +421,8 @@ void QmlGraphicsText::setTextFormat(TextFormat format)
d->updateLayout();
d->markImgDirty();
}
+
+ emit textFormatChanged(d->format);
}
/*!
@@ -439,6 +457,7 @@ void QmlGraphicsText::setElideMode(QmlGraphicsText::TextElideMode mode)
d->updateLayout();
d->markImgDirty();
+ emit elideModeChanged(d->elideMode);
}
void QmlGraphicsText::geometryChanged(const QRectF &newGeometry,
diff --git a/src/declarative/graphicsitems/qmlgraphicstext_p.h b/src/declarative/graphicsitems/qmlgraphicstext_p.h
index 717fcb4..8fa2e65 100644
--- a/src/declarative/graphicsitems/qmlgraphicstext_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicstext_p.h
@@ -60,15 +60,15 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsText : public QmlGraphicsItem
Q_ENUMS(TextElideMode)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
- Q_PROPERTY(QFont font READ font WRITE setFont)
- Q_PROPERTY(QColor color READ color WRITE setColor)
- Q_PROPERTY(TextStyle style READ style WRITE setStyle)
- Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign)
- Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign)
- Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### there are several wrap modes in Qt
- Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat)
- Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode?
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged)
+ Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
+ Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged) //### there are several wrap modes in Qt
+ Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
+ Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode?
public:
QmlGraphicsText(QmlGraphicsItem *parent=0);
@@ -130,6 +130,15 @@ public:
Q_SIGNALS:
void textChanged(const QString &text);
void linkActivated(const QString &link);
+ void fontChanged(const QFont &font);
+ void colorChanged(const QColor &color);
+ void styleChanged(TextStyle style);
+ void styleColorChanged(const QColor &color);
+ void horizontalAlignmentChanged(HAlignment alignment);
+ void verticalAlignmentChanged(VAlignment alignment);
+ void wrapChanged(bool wrap);
+ void textFormatChanged(TextFormat textFormat);
+ void elideModeChanged(TextElideMode mode);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index b482db7..5b80ee0 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -908,14 +908,18 @@ QString QmlGraphicsVisualDataModel::stringValue(int index, const QString &name)
QmlDeclarativeData *ddata = QmlDeclarativeData::get(data);
if (ddata && ddata->propertyCache) {
QmlPropertyCache::Data *prop = ddata->propertyCache->property(name);
- if (prop->propType == QVariant::String) {
- void *args[] = { &val, 0 };
- QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
- } else if (prop->propType == qMetaTypeId<QVariant>()) {
- QVariant v;
- void *args[] = { &v, 0 };
- QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
- val = v.toString();
+ if (prop) {
+ if (prop->propType == QVariant::String) {
+ void *args[] = { &val, 0 };
+ QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
+ } else if (prop->propType == qMetaTypeId<QVariant>()) {
+ QVariant v;
+ void *args[] = { &v, 0 };
+ QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
+ val = v.toString();
+ }
+ } else {
+ val = data->property(name.toUtf8()).toString();
}
} else {
val = data->property(name.toUtf8()).toString();
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 172146c..1b35442 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -8,6 +8,7 @@ SOURCES += \
$$PWD/qmlexpression.cpp \
$$PWD/qmlbinding.cpp \
$$PWD/qmlmetaproperty.cpp \
+ $$PWD/qmlmoduleplugin.cpp \
$$PWD/qmlcomponent.cpp \
$$PWD/qmlcontext.cpp \
$$PWD/qmlcustomparser.cpp \
@@ -62,6 +63,7 @@ HEADERS += \
$$PWD/qmlbinding.h \
$$PWD/qmlbinding_p.h \
$$PWD/qmlmetaproperty.h \
+ $$PWD/qmlmoduleplugin.h \
$$PWD/qmlcomponent.h \
$$PWD/qmlcomponent_p.h \
$$PWD/qmlcustomparser_p.h \
diff --git a/src/declarative/qml/qmlbindingoptimizations.cpp b/src/declarative/qml/qmlbindingoptimizations.cpp
index d7105b2..868440e 100644
--- a/src/declarative/qml/qmlbindingoptimizations.cpp
+++ b/src/declarative/qml/qmlbindingoptimizations.cpp
@@ -145,8 +145,10 @@ void QmlOptimizedBindings::run(Binding *binding)
qWarning("ERROR: Circular binding");
QmlContext *context = QmlAbstractExpression::context();
- if (!context)
+ if (!context) {
+ qWarning("QmlOptimizedBindings: Attempted to evaluate an expression in an invalid context");
return;
+ }
QmlContextPrivate *cp = QmlContextPrivate::get(context);
if (binding->property & 0xFFFF0000) {
diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp
index d59fe4e..ff786cf 100644
--- a/src/declarative/qml/qmlcompositetypemanager.cpp
+++ b/src/declarative/qml/qmlcompositetypemanager.cpp
@@ -459,9 +459,9 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
if (dot < 0) dot = imp.version.length();
QString qmldir;
if (imp.type == QmlScriptParser::Import::File && imp.qualifier.isEmpty()) {
- QUrl importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir")));
+ QString importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir"))).toString();
for (int ii = 0; ii < unit->resources.count(); ++ii) {
- if (unit->resources.at(ii)->url == importUrl.toString()) {
+ if (unit->resources.at(ii)->url == importUrl) {
qmldir = QString::fromUtf8(unit->resources.at(ii)->data);
break;
}
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 4467cce..e063981 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -57,8 +57,8 @@
QT_BEGIN_NAMESPACE
QmlContextPrivate::QmlContextPrivate()
-: parent(0), engine(0), isInternal(false), propertyNames(0), notifyIndex(-1),
- highPriorityCount(0), imports(0), expressions(0), contextObjects(0),
+: parent(0), engine(0), isInternal(false), isTemporary(false), propertyNames(0),
+ notifyIndex(-1), highPriorityCount(0), imports(0), expressions(0), contextObjects(0),
idValues(0), idValueCount(0), optimizedBindings(0)
{
}
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index bc8c357..cb89474 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -86,7 +86,9 @@ public:
QmlContext *parent;
QmlEngine *engine;
+
bool isInternal;
+ bool isTemporary;
QmlIntegerCache *propertyNames;
QList<QVariant> propertyValues;
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 0e9b7c4..c44f6b6 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -51,6 +51,7 @@
#include "qmlexpression.h"
#include "qmlcomponent.h"
#include "qmlmetaproperty_p.h"
+#include "qmlmoduleplugin.h"
#include "qmlbinding_p.h"
#include "qmlvme_p.h"
#include "qmlenginedebug_p.h"
@@ -88,6 +89,7 @@
#include <QGraphicsObject>
#include <QtCore/qcryptographichash.h>
+#include <private/qfactoryloader_p.h>
#include <private/qobject_p.h>
#include <private/qscriptdeclarativeclass_p.h>
@@ -648,7 +650,10 @@ QmlContext *QmlEnginePrivate::getContext(QScriptContext *ctxt)
QScriptValue scopeNode = QScriptDeclarativeClass::scopeChainValue(ctxt, -3);
Q_ASSERT(scopeNode.isValid());
Q_ASSERT(QScriptDeclarativeClass::scriptClass(scopeNode) == contextClass);
- return contextClass->contextFromValue(scopeNode);
+ QmlContext *context = contextClass->contextFromValue(scopeNode);
+ while (context && QmlContextPrivate::get(context)->isTemporary)
+ context = context->parentContext();
+ return context;
}
QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
@@ -1150,6 +1155,9 @@ struct QmlEnginePrivate::ImportedNamespace {
}
};
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
+ (QmlModuleFactoryInterface_iid, QLatin1String("/qmlmodules")))
+
class QmlImportsPrivate {
public:
QmlImportsPrivate() : ref(1)
@@ -1187,6 +1195,13 @@ public:
}
}
if (!found) {
+ if (uri != QLatin1String("Qt")) { // skip well-known, it's not in a plugin
+ QFactoryLoader *l = loader();
+ QmlModuleFactoryInterface *factory =
+ qobject_cast<QmlModuleFactoryInterface*>(l->instance(uri));
+ // return value not used currently
+ }
+
// XXX assume it is a built-in type qualifier
isbuiltin = true;
}
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index ab9f9ea..652c5f8 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -421,7 +421,12 @@ QVariant QmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
Q_Q(QmlExpression);
QVariant rv;
- if (!q->engine() || (!data->sse.isValid() && data->expression.isEmpty()))
+ if (!q->engine()) {
+ qWarning("QmlExpression: Attempted to evaluate an expression in an invalid context");
+ return rv;
+ }
+
+ if (!data->sse.isValid() && data->expression.isEmpty())
return rv;
#ifdef Q_ENABLE_PERFORMANCE_LOG
diff --git a/src/declarative/qml/qmlmoduleplugin.cpp b/src/declarative/qml/qmlmoduleplugin.cpp
new file mode 100644
index 0000000..446c7bc
--- /dev/null
+++ b/src/declarative/qml/qmlmoduleplugin.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 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
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** 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.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.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlmoduleplugin.h"
+#include "qstringlist.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QmlModulePlugin
+ \brief The QmlModulePlugin class provides an abstract base for custom QML module plugins.
+ \reentrant
+ \ingroup plugins
+
+ The QML module plugin is a simple plugin interface that makes it
+ easy to add custom QML modules that can be loaded dynamically
+ into applications.
+
+ Writing a QML module plugin is achieved by subclassing this base
+ class, reimplementing the pure virtual function keys(), and
+ exporting the class with the Q_EXPORT_PLUGIN2() macro. See \l{How
+ to Create Qt Plugins} for details.
+
+ The plugin should register QML types with QML_DEFINE_TYPE.
+
+ The strings returned by keys() should be the list of URIs of module
+ that the plugin registers.
+
+ \sa examples/declarative/plugins
+*/
+
+/*!
+ Constructs a QML module plugin with the given \a parent. This is
+ invoked automatically by the Q_EXPORT_PLUGIN2() macro.
+*/
+QmlModulePlugin::QmlModulePlugin(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ Destroys the QML module plugin.
+
+ You never have to call this explicitly. Qt destroys a plugin
+ automatically when it is no longer used.
+*/
+QmlModulePlugin::~QmlModulePlugin()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlmoduleplugin.h b/src/declarative/qml/qmlmoduleplugin.h
new file mode 100644
index 0000000..315209d
--- /dev/null
+++ b/src/declarative/qml/qmlmoduleplugin.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 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
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** 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.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.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLMODULEPLUGIN_H
+#define QMLMODULEPLUGIN_H
+
+#include <QtCore/qplugin.h>
+#include <QtCore/qfactoryinterface.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qbytearray.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+struct Q_DECLARATIVE_EXPORT QmlModuleFactoryInterface : public QFactoryInterface
+{
+};
+
+#define QmlModuleFactoryInterface_iid "com.nokia.Qt.QmlModuleFactoryInterface"
+
+Q_DECLARE_INTERFACE(QmlModuleFactoryInterface, QmlModuleFactoryInterface_iid)
+
+
+class Q_DECLARATIVE_EXPORT QmlModulePlugin : public QObject, public QmlModuleFactoryInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QmlModuleFactoryInterface:QFactoryInterface)
+public:
+ explicit QmlModulePlugin(QObject *parent = 0);
+ ~QmlModulePlugin();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QMLMODULEPLUGIN_H
diff --git a/src/declarative/qml/qmlvaluetype.cpp b/src/declarative/qml/qmlvaluetype.cpp
index 6d08cd1..058fd6e 100644
--- a/src/declarative/qml/qmlvaluetype.cpp
+++ b/src/declarative/qml/qmlvaluetype.cpp
@@ -583,7 +583,9 @@ void QmlFontValueType::setPointSize(qreal size)
qWarning() << "Both point size and pixel size set. Using pixel size.";
return;
}
- font.setPointSizeF(size);
+
+ if (size >= 0.0)
+ font.setPointSizeF(size);
}
int QmlFontValueType::pixelSize() const
@@ -593,8 +595,12 @@ int QmlFontValueType::pixelSize() const
void QmlFontValueType::setPixelSize(int size)
{
- font.setPixelSize(size);
- hasPixelSize = true;
+ if (size >=0) {
+ font.setPixelSize(size);
+ hasPixelSize = true;
+ } else {
+ hasPixelSize = false;
+ }
}
QmlFontValueType::Capitalization QmlFontValueType::capitalization() const
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp
index 8588eff..3b1f068 100644
--- a/src/declarative/qml/qmlvmemetaobject.cpp
+++ b/src/declarative/qml/qmlvmemetaobject.cpp
@@ -273,6 +273,7 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
rv = expr.value();
} else {
QmlContext newCtxt(ctxt);
+ QmlContextPrivate::get(&newCtxt)->isTemporary = true;
QMetaMethod m = method(_id);
QList<QByteArray> names = m.parameterNames();
for (int ii = 0; ii < names.count(); ++ii)