diff options
author | Chris Adams <christopher.adams@nokia.com> | 2011-10-10 12:11:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-06 02:46:28 +0100 |
commit | 564d58025e46c825ec763193767defd78f5e13a0 (patch) | |
tree | 31d046ac0c016df416afd4923fb749d8bf73d6bc /src/declarative/qml/v8/qv8variantresource_p.h | |
parent | 8601f3444f7926a7b47ae217d8bf51044ff61809 (diff) |
Ensure that scarce resources work with var properties
Now that we have a new property type which stores JavaScript handles,
we need to ensure that scarce resources can be used with them.
Task-number: QMLNG-18
Task-number: QTBUG-21843
Change-Id: I4a920ae39e7d33cf5e33362e5e0ee21c74cb35e3
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qv8variantresource_p.h')
-rw-r--r-- | src/declarative/qml/v8/qv8variantresource_p.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/declarative/qml/v8/qv8variantresource_p.h b/src/declarative/qml/v8/qv8variantresource_p.h new file mode 100644 index 0000000000..d1a5f92696 --- /dev/null +++ b/src/declarative/qml/v8/qv8variantresource_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 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$ +** GNU Lesser General Public License Usage +** 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. +** +** 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QV8VARIANTRESOURCE_P_H +#define QV8VARIANTRESOURCE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtCore/qglobal.h> +#include <private/qv8_p.h> +#include <private/qv8engine_p.h> +#include <private/qdeclarativeengine_p.h> + +QT_BEGIN_NAMESPACE + +class QV8VariantResource : public QV8ObjectResource, + public QDeclarativeEnginePrivate::ScarceResourceData +{ + V8_RESOURCE_TYPE(VariantType) + +public: + QV8VariantResource(QV8Engine *engine, const QVariant &data); + + void addVmePropertyReference(); + void removeVmePropertyReference(); + + bool m_isScarceResource; + int m_vmePropertyReferenceCount; +}; + +QT_END_NAMESPACE + +#endif // QV8VARIANTRESOURCE_P_H + |