From 22f5b45d63d5977dbb1207aeb0f5013223e8e7f5 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 18 Feb 2010 18:12:10 +1000 Subject: Removed incorrect Q_UNUSED() macro from QmlPropertyAnimation::transition --- src/declarative/util/qmlanimation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 249bd8e..ff16e08 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -2302,7 +2302,6 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, TransitionDirection direction) { Q_D(QmlPropertyAnimation); - Q_UNUSED(direction); QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(',')); for (int ii = 0; ii < props.count(); ++ii) -- cgit v0.12 From 21df89dae6c0646ec5066efaea0ec2986c7c4588 Mon Sep 17 00:00:00 2001 From: Henrik Hartz Date: Thu, 18 Feb 2010 12:16:28 +0100 Subject: Doc: reformulate why we build a button --- doc/src/declarative/advtutorial1.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/advtutorial1.qdoc b/doc/src/declarative/advtutorial1.qdoc index 86d14ad..09645fd 100644 --- a/doc/src/declarative/advtutorial1.qdoc +++ b/doc/src/declarative/advtutorial1.qdoc @@ -55,8 +55,9 @@ This gives you a basic game window, with room for the game canvas. A new game button and room to display the score. The one thing you may not recognize here is the \l SystemPalette item. This item provides access to the Qt system palette and is used to make the button look more like a system button (for exact native -feel you would use a \l QPushButton). Since we want a fully QML button, and QML does -not include a button, we had to write our own. Below is the code which we wrote to do this: +feel you would use a \l QPushButton). Since we want a fully functional button, +we use the QML elements Text and MouseRegion inside a Rectangle to assemble a +button. Below is the code which we wrote to do this: \snippet declarative/tutorials/samegame/samegame1/Button.qml 0 -- cgit v0.12 From fa1b0faa1ede809dae3c46ecfce0ef760b887b7c Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 17 Feb 2010 16:09:42 +0100 Subject: Compile fix with namepaces Task-number: QTBUG-8205 --- src/declarative/qml/qml.h | 4 +++- src/declarative/qml/qmlsqldatabase_p.h | 3 +++ src/declarative/qml/qmlxmlhttprequest_p.h | 3 +++ tools/qmlviewer/qmlviewer.cpp | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qml.h index c009093..f2b6b08 100644 --- a/src/declarative/qml/qml.h +++ b/src/declarative/qml/qml.h @@ -77,6 +77,7 @@ enum { /* TYPEINFO flags */ }; #define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \ +QT_BEGIN_NAMESPACE \ template <> \ class QmlTypeInfo \ { \ @@ -84,7 +85,8 @@ public: \ enum { \ hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \ }; \ -}; +}; \ +QT_END_NAMESPACE QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlsqldatabase_p.h b/src/declarative/qml/qmlsqldatabase_p.h index 9965a2b..f7d2078 100644 --- a/src/declarative/qml/qmlsqldatabase_p.h +++ b/src/declarative/qml/qmlsqldatabase_p.h @@ -53,6 +53,9 @@ // // We mean it. // + +#include + QT_BEGIN_NAMESPACE class QScriptEngine; diff --git a/src/declarative/qml/qmlxmlhttprequest_p.h b/src/declarative/qml/qmlxmlhttprequest_p.h index 3a81278..11ed027 100644 --- a/src/declarative/qml/qmlxmlhttprequest_p.h +++ b/src/declarative/qml/qmlxmlhttprequest_p.h @@ -53,6 +53,9 @@ // // We mean it. // + +#include + QT_BEGIN_NAMESPACE class QScriptEngine; diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 3cfbee2..cb1bef4 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -135,10 +135,10 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(Screen) -QT_BEGIN_NAMESPACE - QML_DEFINE_TYPE(QmlViewer, 1, 0, Screen, Screen) +QT_BEGIN_NAMESPACE + class SizedMenuBar : public QMenuBar { Q_OBJECT -- cgit v0.12 From 2eb7c3770307fc42f83ba2526270b7acb51802bf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 18 Feb 2010 16:59:12 +0100 Subject: Make QmlDom API internal It's still used by QmlDesigner, therefore the symbols have to be exported. Task-number: QTBUG-6845 --- src/declarative/qml/qml.pri | 2 +- src/declarative/qml/qmldom.cpp | 2 +- src/declarative/qml/qmldom.h | 349 --------------------------- src/declarative/qml/qmldom_p.h | 319 +++++++++++++++++++----- src/declarative/qml/qmldom_p_p.h | 157 ++++++++++++ tests/auto/declarative/qmldom/tst_qmldom.cpp | 2 +- 6 files changed, 421 insertions(+), 410 deletions(-) delete mode 100644 src/declarative/qml/qmldom.h create mode 100644 src/declarative/qml/qmldom_p_p.h diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 021ef9e..a8df61e 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -76,8 +76,8 @@ HEADERS += \ $$PWD/qmlengine_p.h \ $$PWD/qmlexpression_p.h \ $$PWD/qmlprivate.h \ - $$PWD/qmldom.h \ $$PWD/qmldom_p.h \ + $$PWD/qmldom_p_p.h \ $$PWD/qmlrefcount_p.h \ $$PWD/qmlmetatype.h \ $$PWD/qmlengine.h \ diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 52530db..259d57d 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmldom.h" #include "qmldom_p.h" +#include "qmldom_p_p.h" #include "qmlcompositetypedata_p.h" #include "qmlcompiler_p.h" diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h deleted file mode 100644 index 8442f49..0000000 --- a/src/declarative/qml/qmldom.h +++ /dev/null @@ -1,349 +0,0 @@ -/**************************************************************************** -** -** 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 QMLDOM_H -#define QMLDOM_H - -#include "qmlerror.h" - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QString; -class QByteArray; -class QmlDomObject; -class QmlDomList; -class QmlDomValue; -class QmlEngine; -class QmlDomComponent; -class QmlDomImport; -class QIODevice; - -class QmlDomDocumentPrivate; - -class Q_DECLARATIVE_EXPORT QmlDomDocument -{ -public: - QmlDomDocument(); - QmlDomDocument(const QmlDomDocument &); - ~QmlDomDocument(); - QmlDomDocument &operator=(const QmlDomDocument &); - - QList imports() const; - - QList errors() const; - bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl()); - - QmlDomObject rootObject() const; - -private: - QSharedDataPointer d; -}; - -class QmlDomPropertyPrivate; -class Q_DECLARATIVE_EXPORT QmlDomProperty -{ -public: - QmlDomProperty(); - QmlDomProperty(const QmlDomProperty &); - ~QmlDomProperty(); - QmlDomProperty &operator=(const QmlDomProperty &); - - bool isValid() const; - - QByteArray propertyName() const; - QList propertyNameParts() const; - - bool isDefaultProperty() const; - - QmlDomValue value() const; - - int position() const; - int length() const; - -private: - friend class QmlDomObject; - friend class QmlDomDynamicProperty; - QSharedDataPointer d; -}; - -class QmlDomDynamicPropertyPrivate; -class Q_DECLARATIVE_EXPORT QmlDomDynamicProperty -{ -public: - QmlDomDynamicProperty(); - QmlDomDynamicProperty(const QmlDomDynamicProperty &); - ~QmlDomDynamicProperty(); - QmlDomDynamicProperty &operator=(const QmlDomDynamicProperty &); - - bool isValid() const; - - QByteArray propertyName() const; - int propertyType() const; - QByteArray propertyTypeName() const; - - bool isDefaultProperty() const; - QmlDomProperty defaultValue() const; - - bool isAlias() const; - - int position() const; - int length() const; - -private: - friend class QmlDomObject; - QSharedDataPointer d; -}; - -class QmlDomObjectPrivate; -class Q_DECLARATIVE_EXPORT QmlDomObject -{ -public: - QmlDomObject(); - QmlDomObject(const QmlDomObject &); - ~QmlDomObject(); - QmlDomObject &operator=(const QmlDomObject &); - - bool isValid() const; - - QByteArray objectType() const; - QByteArray objectClassName() const; - - int objectTypeMajorVersion() const; - int objectTypeMinorVersion() const; - - QString objectId() const; - - QList properties() const; - QmlDomProperty property(const QByteArray &) const; - - QList dynamicProperties() const; - QmlDomDynamicProperty dynamicProperty(const QByteArray &) const; - - bool isCustomType() const; - QByteArray customTypeData() const; - - bool isComponent() const; - QmlDomComponent toComponent() const; - - int position() const; - int length() const; - - QUrl url() const; -private: - friend class QmlDomDocument; - friend class QmlDomComponent; - friend class QmlDomValue; - friend class QmlDomValueValueSource; - friend class QmlDomValueValueInterceptor; - QSharedDataPointer d; -}; - -class QmlDomValuePrivate; -class QmlDomBasicValuePrivate; -class Q_DECLARATIVE_EXPORT QmlDomValueLiteral -{ -public: - QmlDomValueLiteral(); - QmlDomValueLiteral(const QmlDomValueLiteral &); - ~QmlDomValueLiteral(); - QmlDomValueLiteral &operator=(const QmlDomValueLiteral &); - - QString literal() const; - -private: - friend class QmlDomValue; - QSharedDataPointer d; -}; - -class Q_DECLARATIVE_EXPORT QmlDomValueBinding -{ -public: - QmlDomValueBinding(); - QmlDomValueBinding(const QmlDomValueBinding &); - ~QmlDomValueBinding(); - QmlDomValueBinding &operator=(const QmlDomValueBinding &); - - QString binding() const; - -private: - friend class QmlDomValue; - QSharedDataPointer d; -}; - -class Q_DECLARATIVE_EXPORT QmlDomValueValueSource -{ -public: - QmlDomValueValueSource(); - QmlDomValueValueSource(const QmlDomValueValueSource &); - ~QmlDomValueValueSource(); - QmlDomValueValueSource &operator=(const QmlDomValueValueSource &); - - QmlDomObject object() const; - -private: - friend class QmlDomValue; - QSharedDataPointer d; -}; - -class Q_DECLARATIVE_EXPORT QmlDomValueValueInterceptor -{ -public: - QmlDomValueValueInterceptor(); - QmlDomValueValueInterceptor(const QmlDomValueValueInterceptor &); - ~QmlDomValueValueInterceptor(); - QmlDomValueValueInterceptor &operator=(const QmlDomValueValueInterceptor &); - - QmlDomObject object() const; - -private: - friend class QmlDomValue; - QSharedDataPointer d; -}; - - -class Q_DECLARATIVE_EXPORT QmlDomComponent : public QmlDomObject -{ -public: - QmlDomComponent(); - QmlDomComponent(const QmlDomComponent &); - ~QmlDomComponent(); - QmlDomComponent &operator=(const QmlDomComponent &); - - QmlDomObject componentRoot() const; -}; - -class Q_DECLARATIVE_EXPORT QmlDomValue -{ -public: - enum Type { - Invalid, - Literal, - PropertyBinding, - ValueSource, - ValueInterceptor, - Object, - List - }; - - QmlDomValue(); - QmlDomValue(const QmlDomValue &); - ~QmlDomValue(); - QmlDomValue &operator=(const QmlDomValue &); - - Type type() const; - - bool isInvalid() const; - bool isLiteral() const; - bool isBinding() const; - bool isValueSource() const; - bool isValueInterceptor() const; - bool isObject() const; - bool isList() const; - - QmlDomValueLiteral toLiteral() const; - QmlDomValueBinding toBinding() const; - QmlDomValueValueSource toValueSource() const; - QmlDomValueValueInterceptor toValueInterceptor() const; - QmlDomObject toObject() const; - QmlDomList toList() const; - - int position() const; - int length() const; - -private: - friend class QmlDomProperty; - friend class QmlDomList; - QSharedDataPointer d; -}; - -class Q_DECLARATIVE_EXPORT QmlDomList -{ -public: - QmlDomList(); - QmlDomList(const QmlDomList &); - ~QmlDomList(); - QmlDomList &operator=(const QmlDomList &); - - QList values() const; - - int position() const; - int length() const; - - QList commaPositions() const; - -private: - friend class QmlDomValue; - QSharedDataPointer d; -}; - -class QmlDomImportPrivate; -class Q_DECLARATIVE_EXPORT QmlDomImport -{ -public: - enum Type { Library, File }; - - QmlDomImport(); - QmlDomImport(const QmlDomImport &); - ~QmlDomImport(); - QmlDomImport &operator=(const QmlDomImport &); - - Type type() const; - QString uri() const; - QString version() const; - QString qualifier() const; - -private: - friend class QmlDomDocument; - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLDOM_H diff --git a/src/declarative/qml/qmldom_p.h b/src/declarative/qml/qmldom_p.h index df6a980..a823c69 100644 --- a/src/declarative/qml/qmldom_p.h +++ b/src/declarative/qml/qmldom_p.h @@ -53,105 +53,308 @@ // We mean it. // -#include "qmlparser_p.h" +#include "qmlerror.h" -#include +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlDomDocumentPrivate : public QSharedData +QT_MODULE(Declarative) + +class QString; +class QByteArray; +class QmlDomObject; +class QmlDomList; +class QmlDomValue; +class QmlEngine; +class QmlDomComponent; +class QmlDomImport; +class QIODevice; + +class QmlDomDocumentPrivate; + +class Q_DECLARATIVE_EXPORT QmlDomDocument { public: - QmlDomDocumentPrivate(); - QmlDomDocumentPrivate(const QmlDomDocumentPrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomDocumentPrivate(); - - QList errors; - QList imports; - QmlParser::Object *root; - QList automaticSemicolonOffsets; + QmlDomDocument(); + QmlDomDocument(const QmlDomDocument &); + ~QmlDomDocument(); + QmlDomDocument &operator=(const QmlDomDocument &); + + QList imports() const; + + QList errors() const; + bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl()); + + QmlDomObject rootObject() const; + +private: + QSharedDataPointer d; +}; + +class QmlDomPropertyPrivate; +class Q_DECLARATIVE_EXPORT QmlDomProperty +{ +public: + QmlDomProperty(); + QmlDomProperty(const QmlDomProperty &); + ~QmlDomProperty(); + QmlDomProperty &operator=(const QmlDomProperty &); + + bool isValid() const; + + QByteArray propertyName() const; + QList propertyNameParts() const; + + bool isDefaultProperty() const; + + QmlDomValue value() const; + + int position() const; + int length() const; + +private: + friend class QmlDomObject; + friend class QmlDomDynamicProperty; + QSharedDataPointer d; }; -class QmlDomObjectPrivate : public QSharedData +class QmlDomDynamicPropertyPrivate; +class Q_DECLARATIVE_EXPORT QmlDomDynamicProperty { public: - QmlDomObjectPrivate(); - QmlDomObjectPrivate(const QmlDomObjectPrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomObjectPrivate(); + QmlDomDynamicProperty(); + QmlDomDynamicProperty(const QmlDomDynamicProperty &); + ~QmlDomDynamicProperty(); + QmlDomDynamicProperty &operator=(const QmlDomDynamicProperty &); + + bool isValid() const; + + QByteArray propertyName() const; + int propertyType() const; + QByteArray propertyTypeName() const; + + bool isDefaultProperty() const; + QmlDomProperty defaultValue() const; + + bool isAlias() const; - typedef QList > Properties; - Properties properties() const; - Properties properties(QmlParser::Property *) const; + int position() const; + int length() const; - QmlParser::Object *object; +private: + friend class QmlDomObject; + QSharedDataPointer d; }; -class QmlDomPropertyPrivate : public QSharedData +class QmlDomObjectPrivate; +class Q_DECLARATIVE_EXPORT QmlDomObject { public: - QmlDomPropertyPrivate(); - QmlDomPropertyPrivate(const QmlDomPropertyPrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomPropertyPrivate(); + QmlDomObject(); + QmlDomObject(const QmlDomObject &); + ~QmlDomObject(); + QmlDomObject &operator=(const QmlDomObject &); + + bool isValid() const; + + QByteArray objectType() const; + QByteArray objectClassName() const; + + int objectTypeMajorVersion() const; + int objectTypeMinorVersion() const; + + QString objectId() const; - QByteArray propertyName; - QmlParser::Property *property; + QList properties() const; + QmlDomProperty property(const QByteArray &) const; + + QList dynamicProperties() const; + QmlDomDynamicProperty dynamicProperty(const QByteArray &) const; + + bool isCustomType() const; + QByteArray customTypeData() const; + + bool isComponent() const; + QmlDomComponent toComponent() const; + + int position() const; + int length() const; + + QUrl url() const; +private: + friend class QmlDomDocument; + friend class QmlDomComponent; + friend class QmlDomValue; + friend class QmlDomValueValueSource; + friend class QmlDomValueValueInterceptor; + QSharedDataPointer d; }; -class QmlDomDynamicPropertyPrivate : public QSharedData +class QmlDomValuePrivate; +class QmlDomBasicValuePrivate; +class Q_DECLARATIVE_EXPORT QmlDomValueLiteral { public: - QmlDomDynamicPropertyPrivate(); - QmlDomDynamicPropertyPrivate(const QmlDomDynamicPropertyPrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomDynamicPropertyPrivate(); + QmlDomValueLiteral(); + QmlDomValueLiteral(const QmlDomValueLiteral &); + ~QmlDomValueLiteral(); + QmlDomValueLiteral &operator=(const QmlDomValueLiteral &); + + QString literal() const; - bool valid; - QmlParser::Object::DynamicProperty property; +private: + friend class QmlDomValue; + QSharedDataPointer d; }; -class QmlDomValuePrivate : public QSharedData +class Q_DECLARATIVE_EXPORT QmlDomValueBinding { public: - QmlDomValuePrivate(); - QmlDomValuePrivate(const QmlDomValuePrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomValuePrivate(); + QmlDomValueBinding(); + QmlDomValueBinding(const QmlDomValueBinding &); + ~QmlDomValueBinding(); + QmlDomValueBinding &operator=(const QmlDomValueBinding &); - QmlParser::Property *property; - QmlParser::Value *value; + QString binding() const; + +private: + friend class QmlDomValue; + QSharedDataPointer d; }; -class QmlDomBasicValuePrivate : public QSharedData +class Q_DECLARATIVE_EXPORT QmlDomValueValueSource { public: - QmlDomBasicValuePrivate(); - QmlDomBasicValuePrivate(const QmlDomBasicValuePrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomBasicValuePrivate(); + QmlDomValueValueSource(); + QmlDomValueValueSource(const QmlDomValueValueSource &); + ~QmlDomValueValueSource(); + QmlDomValueValueSource &operator=(const QmlDomValueValueSource &); + + QmlDomObject object() const; - QmlParser::Value *value; +private: + friend class QmlDomValue; + QSharedDataPointer d; }; -class QmlDomImportPrivate : public QSharedData +class Q_DECLARATIVE_EXPORT QmlDomValueValueInterceptor { public: - QmlDomImportPrivate(); - QmlDomImportPrivate(const QmlDomImportPrivate &o) - : QSharedData(o) { qFatal("Not impl"); } - ~QmlDomImportPrivate(); + QmlDomValueValueInterceptor(); + QmlDomValueValueInterceptor(const QmlDomValueValueInterceptor &); + ~QmlDomValueValueInterceptor(); + QmlDomValueValueInterceptor &operator=(const QmlDomValueValueInterceptor &); + QmlDomObject object() const; + +private: + friend class QmlDomValue; + QSharedDataPointer d; +}; + + +class Q_DECLARATIVE_EXPORT QmlDomComponent : public QmlDomObject +{ +public: + QmlDomComponent(); + QmlDomComponent(const QmlDomComponent &); + ~QmlDomComponent(); + QmlDomComponent &operator=(const QmlDomComponent &); + + QmlDomObject componentRoot() const; +}; + +class Q_DECLARATIVE_EXPORT QmlDomValue +{ +public: + enum Type { + Invalid, + Literal, + PropertyBinding, + ValueSource, + ValueInterceptor, + Object, + List + }; + + QmlDomValue(); + QmlDomValue(const QmlDomValue &); + ~QmlDomValue(); + QmlDomValue &operator=(const QmlDomValue &); + + Type type() const; + + bool isInvalid() const; + bool isLiteral() const; + bool isBinding() const; + bool isValueSource() const; + bool isValueInterceptor() const; + bool isObject() const; + bool isList() const; + + QmlDomValueLiteral toLiteral() const; + QmlDomValueBinding toBinding() const; + QmlDomValueValueSource toValueSource() const; + QmlDomValueValueInterceptor toValueInterceptor() const; + QmlDomObject toObject() const; + QmlDomList toList() const; + + int position() const; + int length() const; + +private: + friend class QmlDomProperty; + friend class QmlDomList; + QSharedDataPointer d; +}; + +class Q_DECLARATIVE_EXPORT QmlDomList +{ +public: + QmlDomList(); + QmlDomList(const QmlDomList &); + ~QmlDomList(); + QmlDomList &operator=(const QmlDomList &); + + QList values() const; + + int position() const; + int length() const; + + QList commaPositions() const; + +private: + friend class QmlDomValue; + QSharedDataPointer d; +}; + +class QmlDomImportPrivate; +class Q_DECLARATIVE_EXPORT QmlDomImport +{ +public: enum Type { Library, File }; - Type type; - QString uri; - QString version; - QString qualifier; + QmlDomImport(); + QmlDomImport(const QmlDomImport &); + ~QmlDomImport(); + QmlDomImport &operator=(const QmlDomImport &); + + Type type() const; + QString uri() const; + QString version() const; + QString qualifier() const; + +private: + friend class QmlDomDocument; + QSharedDataPointer d; }; QT_END_NAMESPACE -#endif // QMLDOM_P_H +QT_END_HEADER +#endif // QMLDOM_P_H diff --git a/src/declarative/qml/qmldom_p_p.h b/src/declarative/qml/qmldom_p_p.h new file mode 100644 index 0000000..9d955b0 --- /dev/null +++ b/src/declarative/qml/qmldom_p_p.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** 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 QMLDOM_P_P_H +#define QMLDOM_P_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 "qmlparser_p.h" + +#include + +QT_BEGIN_NAMESPACE + +class QmlDomDocumentPrivate : public QSharedData +{ +public: + QmlDomDocumentPrivate(); + QmlDomDocumentPrivate(const QmlDomDocumentPrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomDocumentPrivate(); + + QList errors; + QList imports; + QmlParser::Object *root; + QList automaticSemicolonOffsets; +}; + +class QmlDomObjectPrivate : public QSharedData +{ +public: + QmlDomObjectPrivate(); + QmlDomObjectPrivate(const QmlDomObjectPrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomObjectPrivate(); + + typedef QList > Properties; + Properties properties() const; + Properties properties(QmlParser::Property *) const; + + QmlParser::Object *object; +}; + +class QmlDomPropertyPrivate : public QSharedData +{ +public: + QmlDomPropertyPrivate(); + QmlDomPropertyPrivate(const QmlDomPropertyPrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomPropertyPrivate(); + + QByteArray propertyName; + QmlParser::Property *property; +}; + +class QmlDomDynamicPropertyPrivate : public QSharedData +{ +public: + QmlDomDynamicPropertyPrivate(); + QmlDomDynamicPropertyPrivate(const QmlDomDynamicPropertyPrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomDynamicPropertyPrivate(); + + bool valid; + QmlParser::Object::DynamicProperty property; +}; + +class QmlDomValuePrivate : public QSharedData +{ +public: + QmlDomValuePrivate(); + QmlDomValuePrivate(const QmlDomValuePrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomValuePrivate(); + + QmlParser::Property *property; + QmlParser::Value *value; +}; + +class QmlDomBasicValuePrivate : public QSharedData +{ +public: + QmlDomBasicValuePrivate(); + QmlDomBasicValuePrivate(const QmlDomBasicValuePrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomBasicValuePrivate(); + + QmlParser::Value *value; +}; + +class QmlDomImportPrivate : public QSharedData +{ +public: + QmlDomImportPrivate(); + QmlDomImportPrivate(const QmlDomImportPrivate &o) + : QSharedData(o) { qFatal("Not impl"); } + ~QmlDomImportPrivate(); + + enum Type { Library, File }; + + Type type; + QString uri; + QString version; + QString qualifier; +}; + +QT_END_NAMESPACE + +#endif // QMLDOM_P_P_H + diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp index eb4d419..2ff427c 100644 --- a/tests/auto/declarative/qmldom/tst_qmldom.cpp +++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include -- cgit v0.12