source: trunk/doc/src/development/activeqt-dumpcpp.qdoc

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 4.9 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the documentation of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:FDL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in a
14** written agreement between you and Nokia.
15**
16** GNU Free Documentation License
17** Alternatively, this file may be used under the terms of the GNU Free
18** Documentation License version 1.3 as published by the Free Software
19** Foundation and appearing in the file included in the packaging of this
20** file.
21**
22** If you have questions regarding the use of this file, please contact
23** Nokia at [email protected].
24** $QT_END_LICENSE$
25**
26****************************************************************************/
27
28/*!
29 \page activeqt-dumpcpp.html
30 \title The dumpcpp Tool (ActiveQt)
31
32 \ingroup activeqt-tools
33
34 \keyword dumpcpp
35
36 The \c dumpcpp tool generates a C++ namespace for a type library.
37
38 To generate a C++ namespace for a type library, call \c dumpcpp with the following
39 command line parameters:
40
41 \table
42 \header
43 \i Option
44 \i Result
45 \row
46 \i input
47 \i Generate documentation for \e input. \e input can specify a type library file or a type
48 library ID, or a CLSID or ProgID for an object
49 \row
50 \i -o file
51 \i Writes the class declaration to \e {file}.h and meta object infomation to \e {file}.cpp
52 \row
53 \i -n namespace
54 \i Generate a C++ namespace \e namespace
55 \row
56 \i -nometaobject
57 \i Do not generate a .cpp file with the meta object information.
58 The meta object is then generated in runtime.
59 \row
60 \i -getfile libid
61 \i Print the filename for the typelibrary \e libid to stdout
62 \row
63 \i -compat
64 \i Generate namespace with dynamicCall-compatible API
65 \row
66 \i -v
67 \i Print version information
68 \row
69 \i -h
70 \i Print help
71 \endtable
72
73 \c dumpcpp can be integrated into the \c qmake build system. In your .pro file, list the type
74 libraries you want to use in the TYPELIBS variable:
75
76 \snippet examples/activeqt/qutlook/qutlook.pro 0
77
78 The generated namespace will declare all enumerations, as well as one QAxObject subclass
79 for each \c coclass and \c interface declared in the type library. coclasses marked with
80 the \c control attribute will be wrapped by a QAxWidget subclass.
81
82 Those classes that wrap creatable coclasses (i.e. coclasses that are not marked
83 as \c noncreatable) have a default constructor; this is typically a single class
84 of type \c Application.
85
86 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 0
87
88 All other classes can only be created by passing an IDispatch interface pointer
89 to the constructor; those classes should however not be created explicitly.
90 Instead, use the appropriate API of already created objects.
91
92 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 1
93
94 All coclass wrappers also have one constructors taking an interface wrapper class
95 for each interface implemented.
96
97 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 2
98
99 You have to create coclasses to be able to connect to signals of the subobject.
100 Note that the constructor deletes the interface object, so the following will
101 cause a segmentation fault:
102
103 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 3
104
105 If the return type is of a coclass or interface type declared in another type
106 library you have to include the namespace header for that other type library
107 before including the header for the namespace you want to use (both header have
108 to be generated with this tool).
109
110 By default, methods and property returning subobjects will use the type as in
111 the type library. The caller of the function is responsible for deleting or
112 reparenting the object returned. If the \c -compat switch is set, properties
113 and method returning a COM object have the return type \c IDispatch*, and
114 the namespace will not declare wrapper classes for interfaces.
115
116 In this case, create the correct wrapper class explicitly:
117
118 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 4
119
120 You can of course use the IDispatch* returned directly, in which case you have to
121 call \c Release() when finished with the interface.
122
123 All classes in the namespace are tagged with a macro that allows you to export
124 or import them from a DLL. To do that, declare the macro to expand to
125 \c __declspec(dllimport/export) before including the header file.
126
127 To build the tool you must first build the QAxContainer library.
128 Then run your make tool in \c tools/dumpcpp.
129*/
Note: See TracBrowser for help on using the repository browser.