/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the documentation 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$ ** ****************************************************************************/ /*! \example activeqt/qutlook \title Qutlook Example (ActiveQt) The Qutlook example demonstrates the use of ActiveQt to automate Outlook. The example makes use of the \l dumpcpp tool to generate a C++ namespace for the type library describing the Outlook Object Model. The project file for the example looks like this: \snippet examples/activeqt/qutlook/qutlook.pro 1 \snippet examples/activeqt/qutlook/qutlook.pro 2 The project file uses the \c dumpcpp tool to add an MS Outlook type library to the project. If this fails, then the generated makefile will just print an error message, otherwise the build step will now run the \e dumpcpp tool on the type library, and generate a header and a cpp file (in this case, \c msoutl.h and \c msoutl.cpp) that declares and implement an easy to use API to the Outlook objects. \snippet examples/activeqt/qutlook/addressview.h 0 The AddressView class is a QWidget subclass for the user interface. The QTreeView widget will display the contents of Outlook's Contact folder as provided by the \c{model}. \snippet examples/activeqt/qutlook/addressview.cpp 0 The AddressBookModel class is a QAbstractListModel subclass that communicates directly with Outlook, using a QHash for caching. \snippet examples/activeqt/qutlook/addressview.cpp 1 The constructor initializes Outlook. The various signals Outlook provides to notify about contents changes are connected to the \c updateOutlook() slot. \snippet examples/activeqt/qutlook/addressview.cpp 2 The destructor logs off from the session. \snippet examples/activeqt/qutlook/addressview.cpp 3 The \c rowCount() implementation returns the number of entries as reported by Outlook. \c columnCount and \c headerData are implemented to show four columns in the tree view. \snippet examples/activeqt/qutlook/addressview.cpp 4 The \c headerData() implementation returns hardcoded strings. \snippet examples/activeqt/qutlook/addressview.cpp 5 The \c data() implementation is the core of the model. If the requested data is in the cache the cached value is used, otherwise the data is acquired from Outlook. \snippet examples/activeqt/qutlook/addressview.cpp 6 The \c changeItem() slot is called when the user changes the current entry using the user interface. The Outlook item is accessed using the Outlook API, and is modified using the property setters. Finally, the item is saved to Outlook, and removed from the cache. Note that the model does not signal the view of the data change, as Outlook will emit a signal on its own. \snippet examples/activeqt/qutlook/addressview.cpp 7 The \c addItem() slot calls the CreateItem method of Outlook to create a new contact item, sets the properties of the new item to the values entered by the user and saves the item. \snippet examples/activeqt/qutlook/addressview.cpp 8 The \c update() slot clears the cache, and emits the reset() signal to notify the view about the data change requiring a redraw of the contents. \snippet examples/activeqt/qutlook/addressview.cpp 9 \snippet examples/activeqt/qutlook/addressview.cpp 10 The rest of the file implements the user interface using only Qt APIs, i.e. without communicating with Outlook directly. \snippet examples/activeqt/qutlook/main.cpp 0 The \c main() entry point function finally instantiates the user interface and enters the event loop. To build the example you must first build the QAxContainer library. Then run your make tool in \c examples/activeqt/qutlook and run the resulting \c qutlook.exe. */ ot/Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.zip'>Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.zip
Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.tar.gz
Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.tar.bz2
Cleanup (remove QDeclarativeScriptClass)
QDeclarativeScriptClass only existed to make compiling against 4.6 and 4.7 easier.
Diffstat
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp14
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass.cpp4
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp19
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h8
-rw-r--r--src/declarative/qml/qdeclarativescriptclass_p.h89
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp4
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass_p.h7
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass.cpp8
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass_p.h6
-rw-r--r--src/declarative/qml/qml.pri1
13 files changed, 34 insertions, 142 deletions
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
index 8566744..6d31c22 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
@@ -79,7 +79,7 @@ struct ContextData : public QScriptDeclarativeClass::Object {
via QtScript.
*/
QDeclarativeContextScriptClass::QDeclarativeContextScriptClass(QDeclarativeEngine *bindEngine)
-: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1)
{
}
@@ -223,7 +223,7 @@ QDeclarativeContextScriptClass::queryProperty(QDeclarativeContextData *bindConte
return 0;
}
-QDeclarativeContextScriptClass::ScriptValue
+QDeclarativeContextScriptClass::Value
QDeclarativeContextScriptClass::property(Object *object, const Identifier &name)
{
Q_UNUSED(object);
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass_p.h b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
index b89f0cd..1936d38 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
@@ -54,14 +54,14 @@
//
#include "private/qdeclarativetypenamecache_p.h"
-#include "private/qdeclarativescriptclass_p.h"
+#include <private/qscriptdeclarativeclass_p.h>
QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
class QDeclarativeContext;
class QDeclarativeContextData;
-class QDeclarativeContextScriptClass : public QDeclarativeScriptClass
+class QDeclarativeContextScriptClass : public QScriptDeclarativeClass
{
public:
QDeclarativeContextScriptClass(QDeclarativeEngine *);
@@ -76,7 +76,7 @@ public:
protected:
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
QScriptClass::QueryFlags flags);
- virtual ScriptValue property(Object *, const Identifier &);
+ virtual Value property(Object *, const Identifier &);
virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
private:
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index f7d1df3..e8b6913 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -61,7 +61,6 @@
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativeworkerscript_p.h"
#include "private/qdeclarativecomponent_p.h"
-#include "private/qdeclarativescriptclass_p.h"
#include "qdeclarativenetworkaccessmanagerfactory.h"
#include "qdeclarativeimageprovider.h"
#include "private/qdeclarativedirparser_p.h"
@@ -1365,19 +1364,6 @@ QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val
}
}
-QDeclarativeScriptClass::QDeclarativeScriptClass(QScriptEngine *engine)
-: QScriptDeclarativeClass(engine)
-{
-}
-
-QVariant QDeclarativeScriptClass::toVariant(QDeclarativeEngine *engine, const QScriptValue &val)
-{
- QDeclarativeEnginePrivate *ep =
- static_cast<QDeclarativeEnginePrivate *>(QObjectPrivate::get(engine));
-
- return ep->scriptValueToVariant(val);
-}
-
// XXX this beyonds in QUrl::toLocalFile()
// WARNING, there is a copy of this function in qdeclarativecompositetypemanager.cpp
static QString toLocalFileOrQrc(const QUrl& url)
diff --git a/src/declarative/qml/qdeclarativelistscriptclass.cpp b/src/declarative/qml/qdeclarativelistscriptclass.cpp
index 3958dd5..d27427e 100644
--- a/src/declarative/qml/qdeclarativelistscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativelistscriptclass.cpp
@@ -54,7 +54,7 @@ struct ListData : public QScriptDeclarativeClass::Object {
};
QDeclarativeListScriptClass::QDeclarativeListScriptClass(QDeclarativeEngine *e)
-: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(e)), engine(e)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(e)), engine(e)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
Q_UNUSED(scriptEngine);
@@ -114,7 +114,7 @@ QDeclarativeListScriptClass::queryProperty(Object *object, const Identifier &nam
}
}
-QDeclarativeListScriptClass::ScriptValue QDeclarativeListScriptClass::property(Object *obj, const Identifier &name)
+QDeclarativeListScriptClass::Value QDeclarativeListScriptClass::property(Object *obj, const Identifier &name)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
diff --git a/src/declarative/qml/qdeclarativelistscriptclass_p.h b/src/declarative/qml/qdeclarativelistscriptclass_p.h