source: trunk/doc/src/activeqt-dumpcpp.qdoc@ 477

Last change on this file since 477 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.8 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the documentation of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*!
43 \page activeqt-dumpcpp.html
44 \title The dumpcpp Tool (ActiveQt)
45
46 \ingroup activeqt-tools
47
48 \keyword dumpcpp
49
50 The \c dumpcpp tool generates a C++ namespace for a type library.
51
52 To generate a C++ namespace for a type library, call \c dumpcpp with the following
53 command line parameters:
54
55 \table
56 \header
57 \i Option
58 \i Result
59 \row
60 \i input
61 \i Generate documentation for \e input. \e input can specify a type library file or a type
62 library ID, or a CLSID or ProgID for an object
63 \row
64 \i -o file
65 \i Writes the class declaration to \e {file}.h and meta object infomation to \e {file}.cpp
66 \row
67 \i -n namespace
68 \i Generate a C++ namespace \e namespace
69 \row
70 \i -nometaobject
71 \i Do not generate a .cpp file with the meta object information.
72 The meta object is then generated in runtime.
73 \row
74 \i -getfile libid
75 \i Print the filename for the typelibrary \e libid to stdout
76 \row
77 \i -compat
78 \i Generate namespace with dynamicCall-compatible API
79 \row
80 \i -v
81 \i Print version information
82 \row
83 \i -h
84 \i Print help
85 \endtable
86
87 \c dumpcpp can be integrated into the \c qmake build system. In your .pro file, list the type
88 libraries you want to use in the TYPELIBS variable:
89
90 \snippet examples/activeqt/qutlook/qutlook.pro 0
91
92 The generated namespace will declare all enumerations, as well as one QAxObject subclass
93 for each \c coclass and \c interface declared in the type library. coclasses marked with
94 the \c control attribute will be wrapped by a QAxWidget subclass.
95
96 Those classes that wrap creatable
97 coclasses
98(i.e. coclasses that are not marked
99 as \c noncreatable) have a default constructor; this is typically a single class
100 of type \c Application.
101
102 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 0
103
104 All other classes can only be created by passing an IDispatch interface pointer
105 to the constructor; those classes should however not
106be created explicitly.
107 Instead, use the appropriate API of already created
108 objects.
109
110 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 1
111
112 All coclass wrappers also have one constructors taking an interface wrapper class
113 for each interface implemented.
114
115 \snippet doc/src/snippets/code/doc_src_activeqt-dumpcpp.qdoc 2
116
117 You have to create coclasses to be able to connect to signals of the subobject.