Qt 4.8
qdeclarativeutilmodule.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "private/qdeclarativeutilmodule_p.h"
43 #include "private/qdeclarativeanimation_p.h"
44 #include "private/qdeclarativeanimation_p_p.h"
45 #include "private/qdeclarativebehavior_p.h"
46 #include "private/qdeclarativebind_p.h"
47 #include "private/qdeclarativeconnections_p.h"
48 #include "private/qdeclarativesmoothedanimation_p.h"
49 #include "private/qdeclarativefontloader_p.h"
50 #include "private/qdeclarativelistaccessor_p.h"
51 #include "private/qdeclarativelistmodel_p.h"
52 #include "private/qdeclarativenullablevalue_p_p.h"
53 #include "private/qdeclarativeopenmetaobject_p.h"
54 #include "private/qdeclarativepackage_p.h"
55 #include "private/qdeclarativepixmapcache_p.h"
56 #include "private/qdeclarativepropertychanges_p.h"
58 #include "private/qdeclarativespringanimation_p.h"
59 #include "private/qdeclarativestategroup_p.h"
60 #include "private/qdeclarativestateoperations_p.h"
61 #include "private/qdeclarativestate_p.h"
62 #include "private/qdeclarativestate_p_p.h"
63 #include "private/qdeclarativestyledtext_p.h"
64 #include "private/qdeclarativesystempalette_p.h"
65 #include "private/qdeclarativetimeline_p_p.h"
66 #include "private/qdeclarativetimer_p.h"
67 #include "private/qdeclarativetransitionmanager_p_p.h"
68 #include "private/qdeclarativetransition_p.h"
69 #include "private/qdeclarativeapplication_p.h"
70 #include "qdeclarativeview.h"
71 #include "qdeclarativeinfo.h"
72 #include "private/qdeclarativetypenotavailable_p.h"
73 #ifndef QT_NO_XMLPATTERNS
74 #include "private/qdeclarativexmllistmodel_p.h"
75 #endif
76 
78 {
80  qmlRegisterUncreatableType<QDeclarativeApplication>("QtQuick",1,1,"Application", QDeclarativeApplication::tr("Application is an abstract class"));
81 
82  qmlRegisterType<QDeclarativeAnchorAnimation>("QtQuick",1,0,"AnchorAnimation");
83  qmlRegisterType<QDeclarativeAnchorChanges>("QtQuick",1,0,"AnchorChanges");
84  qmlRegisterType<QDeclarativeBehavior>("QtQuick",1,0,"Behavior");
85  qmlRegisterType<QDeclarativeColorAnimation>("QtQuick",1,0,"ColorAnimation");
86  qmlRegisterType<QDeclarativeSmoothedAnimation>("QtQuick",1,0,"SmoothedAnimation");
87  qmlRegisterType<QDeclarativeFontLoader>("QtQuick",1,0,"FontLoader");
88  qmlRegisterType<QDeclarativeNumberAnimation>("QtQuick",1,0,"NumberAnimation");
89  qmlRegisterType<QDeclarativePackage>("QtQuick",1,0,"Package");
90  qmlRegisterType<QDeclarativeParallelAnimation>("QtQuick",1,0,"ParallelAnimation");
91  qmlRegisterType<QDeclarativeParentAnimation>("QtQuick",1,0,"ParentAnimation");
92  qmlRegisterType<QDeclarativeParentChange>("QtQuick",1,0,"ParentChange");
93  qmlRegisterType<QDeclarativePauseAnimation>("QtQuick",1,0,"PauseAnimation");
94  qmlRegisterType<QDeclarativePropertyAction>("QtQuick",1,0,"PropertyAction");
95  qmlRegisterType<QDeclarativePropertyAnimation>("QtQuick",1,0,"PropertyAnimation");
96  qmlRegisterType<QDeclarativeRotationAnimation>("QtQuick",1,0,"RotationAnimation");
97  qmlRegisterType<QDeclarativeScriptAction>("QtQuick",1,0,"ScriptAction");
98  qmlRegisterType<QDeclarativeSequentialAnimation>("QtQuick",1,0,"SequentialAnimation");
99  qmlRegisterType<QDeclarativeSpringAnimation>("QtQuick",1,0,"SpringAnimation");
100  qmlRegisterType<QDeclarativeSystemPalette>("QtQuick",1,0,"SystemPalette");
101  qmlRegisterType<QDeclarativeTransition>("QtQuick",1,0,"Transition");
102  qmlRegisterType<QDeclarativeVector3dAnimation>("QtQuick",1,0,"Vector3dAnimation");
103 
104  qmlRegisterType<QDeclarativeAnchors>();
105  qmlRegisterType<QDeclarativeStateOperation>();
106  qmlRegisterType<QDeclarativeAnchorSet>();
107 
108  qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("QtQuick",1,0,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
109  }
110 
111  qmlRegisterType<QDeclarativeBind>("QtQuick",1,0,"Binding");
112  qmlRegisterType<QDeclarativeConnections>("QtQuick",1,0,"Connections");
113  qmlRegisterType<QDeclarativeTimer>("QtQuick",1,0,"Timer");
114  qmlRegisterType<QDeclarativeStateGroup>("QtQuick",1,0,"StateGroup");
115  qmlRegisterType<QDeclarativeState>("QtQuick",1,0,"State");
116  qmlRegisterType<QDeclarativeStateChangeScript>("QtQuick",1,0,"StateChangeScript");
117  qmlRegisterType<QDeclarativeListElement>("QtQuick",1,0,"ListElement");
118 #ifdef QT_NO_XMLPATTERNS
119  qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlListModel",
120  qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
121  qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlRole",
122  qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
123 #else
124  qmlRegisterType<QDeclarativeXmlListModel>("QtQuick",1,0,"XmlListModel");
125  qmlRegisterType<QDeclarativeXmlListModelRole>("QtQuick",1,0,"XmlRole");
126 #endif
127  qmlRegisterCustomType<QDeclarativeConnections>("QtQuick",1,0,"Connections", new QDeclarativeConnectionsParser);
128  qmlRegisterCustomType<QDeclarativePropertyChanges>("QtQuick",1,0,"PropertyChanges", new QDeclarativePropertyChangesParser);
129  qmlRegisterCustomType<QDeclarativeListModel>("QtQuick",1,0,"ListModel", new QDeclarativeListModelParser);
130 }
131 
133 {
134 #ifndef QT_NO_IMPORT_QT47_QML
136  qmlRegisterType<QDeclarativeAnchorAnimation>("Qt",4,7,"AnchorAnimation");
137  qmlRegisterType<QDeclarativeAnchorChanges>("Qt",4,7,"AnchorChanges");
138  qmlRegisterType<QDeclarativeBehavior>("Qt",4,7,"Behavior");
139  qmlRegisterType<QDeclarativeColorAnimation>("Qt",4,7,"ColorAnimation");
140  qmlRegisterType<QDeclarativeSmoothedAnimation>("Qt",4,7,"SmoothedAnimation");
141  qmlRegisterType<QDeclarativeFontLoader>("Qt",4,7,"FontLoader");
142  qmlRegisterType<QDeclarativeNumberAnimation>("Qt",4,7,"NumberAnimation");
143  qmlRegisterType<QDeclarativePackage>("Qt",4,7,"Package");
144  qmlRegisterType<QDeclarativeParallelAnimation>("Qt",4,7,"ParallelAnimation");
145  qmlRegisterType<QDeclarativeParentAnimation>("Qt",4,7,"ParentAnimation");
146  qmlRegisterType<QDeclarativeParentChange>("Qt",4,7,"ParentChange");
147  qmlRegisterType<QDeclarativePauseAnimation>("Qt",4,7,"PauseAnimation");
148  qmlRegisterType<QDeclarativePropertyAction>("Qt",4,7,"PropertyAction");
149  qmlRegisterType<QDeclarativePropertyAnimation>("Qt",4,7,"PropertyAnimation");
150  qmlRegisterType<QDeclarativeRotationAnimation>("Qt",4,7,"RotationAnimation");
151  qmlRegisterType<QDeclarativeScriptAction>("Qt",4,7,"ScriptAction");
152  qmlRegisterType<QDeclarativeSequentialAnimation>("Qt",4,7,"SequentialAnimation");
153  qmlRegisterType<QDeclarativeSpringAnimation>("Qt",4,7,"SpringAnimation");
154  qmlRegisterType<QDeclarativeSystemPalette>("Qt",4,7,"SystemPalette");
155  qmlRegisterType<QDeclarativeTransition>("Qt",4,7,"Transition");
156  qmlRegisterType<QDeclarativeVector3dAnimation>("Qt",4,7,"Vector3dAnimation");
157 
158  qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("Qt",4,7,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
159  }
160 
161  qmlRegisterType<QDeclarativeBind>("Qt",4,7,"Binding");
162  qmlRegisterType<QDeclarativeConnections>("Qt",4,7,"Connections");
163  qmlRegisterType<QDeclarativeTimer>("Qt",4,7,"Timer");
164  qmlRegisterType<QDeclarativeStateGroup>("Qt",4,7,"StateGroup");
165  qmlRegisterType<QDeclarativeState>("Qt",4,7,"State");
166  qmlRegisterType<QDeclarativeStateChangeScript>("Qt",4,7,"StateChangeScript");
167  qmlRegisterType<QDeclarativeListElement>("Qt",4,7,"ListElement");
168 
169 #ifdef QT_NO_XMLPATTERNS
170  qmlRegisterTypeNotAvailable("Qt",4,7,"XmlListModel",
171  qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
172  qmlRegisterTypeNotAvailable("Qt",4,7,"XmlRole",
173  qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
174 #else
175  qmlRegisterType<QDeclarativeXmlListModel>("Qt",4,7,"XmlListModel");
176  qmlRegisterType<QDeclarativeXmlListModelRole>("Qt",4,7,"XmlRole");
177 #endif
178  qmlRegisterCustomType<QDeclarativeConnections>("Qt", 4, 7, "Connections", new QDeclarativeConnectionsParser);
179  qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 7, "PropertyChanges", new QDeclarativePropertyChangesParser);
180  qmlRegisterCustomType<QDeclarativeListModel>("Qt", 4,7, "ListModel", new QDeclarativeListModelParser);
181 #endif
182 }
183 
int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &message)
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
#define qApp
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).