diff options
author | Jerome Pasion <jerome.pasion@digia.com> | 2012-12-10 17:28:04 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-11 11:19:50 +0100 |
commit | 30ce8820b9777b14cba5fbbaa9e2be547dbad6bc (patch) | |
tree | 441d17d250e26a778997af41faf5083664b2fea3 | |
parent | 8b99e60c03b50f354f5e33f0d5db53448130be6a (diff) |
Doc: Edited Active Qt documentation
-fixed snippets, examples
-left demos alone. Don't know if they were working.
-updated landing page
-added QAxContainer and QAxServer module pages
Task-number: QTBUG-28042
Change-Id: Ic446680319fa9cc0e917cebdb30d6a246026ac20
Reviewed-by: hjk <qthjk@ovi.com>
-rw-r--r-- | examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc (renamed from src/activeqt/doc/snippets/doc_src_examples_activeqt_comapp.qdoc) | 0 | ||||
-rw-r--r-- | examples/activeqt/comapp/doc/src/comapp.qdoc (renamed from src/activeqt/doc/src/examples/comapp.qdoc) | 40 | ||||
-rw-r--r-- | examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc (renamed from src/activeqt/doc/src/examples/hierarchy-demo-snippet.qdoc) | 0 | ||||
-rw-r--r-- | examples/activeqt/hierarchy/doc/src/hierarchy.qdoc (renamed from src/activeqt/doc/src/examples/hierarchy.qdoc) | 20 | ||||
-rw-r--r-- | examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc (renamed from src/activeqt/doc/snippets/doc_src_examples_activeqt_menus.qdoc) | 0 | ||||
-rw-r--r-- | examples/activeqt/menus/doc/src/menus.qdoc (renamed from src/activeqt/doc/src/examples/menus.qdoc) | 2 | ||||
-rw-r--r-- | examples/activeqt/multiple/doc/src/multiple.qdoc (renamed from src/activeqt/doc/src/examples/multiple.qdoc) | 8 | ||||
-rw-r--r-- | examples/activeqt/opengl/doc/src/opengl.qdoc (renamed from src/activeqt/doc/src/examples/opengl.qdoc) | 34 | ||||
-rw-r--r-- | examples/activeqt/qutlook/doc/src/qutlook.qdoc (renamed from src/activeqt/doc/src/examples/qutlook.qdoc) | 40 | ||||
-rw-r--r-- | examples/activeqt/simple/doc/src/simple.qdoc (renamed from src/activeqt/doc/src/examples/simple.qdoc) | 8 | ||||
-rw-r--r-- | examples/activeqt/webbrowser/doc/src/webbrowser.qdoc (renamed from src/activeqt/doc/src/examples/webbrowser.qdoc) | 18 | ||||
-rw-r--r-- | examples/activeqt/wrapper/doc/src/wrapper.qdoc (renamed from src/activeqt/doc/src/examples/wrapper.qdoc) | 4 | ||||
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 54 | ||||
-rw-r--r-- | src/activeqt/container/qaxscript.cpp | 226 | ||||
-rw-r--r-- | src/activeqt/container/qaxselect.cpp | 6 | ||||
-rw-r--r-- | src/activeqt/control/qaxbindable.cpp | 10 | ||||
-rw-r--r-- | src/activeqt/control/qaxfactory.cpp | 24 | ||||
-rw-r--r-- | src/activeqt/doc/activeqt.qdocconf | 20 | ||||
-rw-r--r-- | src/activeqt/doc/src/activeqt-index.qdoc (renamed from src/activeqt/doc/src/qtaxbase.qdoc) | 44 | ||||
-rw-r--r-- | src/activeqt/doc/src/examples/dotnet.qdoc | 30 | ||||
-rw-r--r-- | src/activeqt/doc/src/qtaxcontainer.qdoc | 78 | ||||
-rw-r--r-- | src/activeqt/doc/src/qtaxserver.qdoc | 199 |
22 files changed, 497 insertions, 368 deletions
diff --git a/src/activeqt/doc/snippets/doc_src_examples_activeqt_comapp.qdoc b/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc index fa6a491..fa6a491 100644 --- a/src/activeqt/doc/snippets/doc_src_examples_activeqt_comapp.qdoc +++ b/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc diff --git a/src/activeqt/doc/src/examples/comapp.qdoc b/examples/activeqt/comapp/doc/src/comapp.qdoc index 397b18f..e1a773d 100644 --- a/src/activeqt/doc/src/examples/comapp.qdoc +++ b/examples/activeqt/comapp/doc/src/comapp.qdoc @@ -36,61 +36,61 @@ has been designed to resemble the APIs of standard COM applications; i.e. those from Microsoft Office. - \snippet examples/activeqt/comapp/main.cpp 2 + \snippet activeqt/comapp/main.cpp 2 The first class \c Application represents the application object. It exposes read-only properties \c documents and \c id to get access to the list of documents, and an identifier. A read/write property \c visible - controls whether the QTabWidget-based user interface of the application + controls whether the QTabWidget-based user interface of the application should be visible, and a slot \c quit() terminates the application. The \e RegisterObject attribute is set to make sure that instances of this class are registered in COM's running object table (ROT) - this allows COM clients to connect to an already instantiated COM object. - \snippet examples/activeqt/comapp/main.cpp 1 + \snippet activeqt/comapp/main.cpp 1 The \c DocumentList class stores a list of documents. It provides an API - to read the number of documents, to access each document by index and to + to read the number of documents, to access each document by index and to create a new document. The \c application property returns the root object. - \snippet examples/activeqt/comapp/main.cpp 0 + \snippet activeqt/comapp/main.cpp 0 The \c Document class finally represents a document in the application. Each document is represented by a page in the application's tab widget, and has a title that is readable and writable through the document's API. The \c application property again returns the root object. - \snippet examples/activeqt/comapp/main.cpp 3 + \snippet activeqt/comapp/main.cpp 3 The implementation of the \c Document class creates a new page for the tab - widget, and uses the title of that page for the title property. The page + widget, and uses the title of that page for the title property. The page is deleted when the document is deleted. - \snippet examples/activeqt/comapp/main.cpp 4 + \snippet activeqt/comapp/main.cpp 4 The \c DocumentList implementation is straightforward. - \snippet examples/activeqt/comapp/main.cpp 5 + \snippet activeqt/comapp/main.cpp 5 The \c Application class initializes the user interface in the constructor, and shows and hides it in the implementation of \c setVisible(). The object - name (accessible through the \c id property) is set to \c "From QAxFactory" - to indicate that this COM object has been created by COM. Note that there is - no destructor that would delete the QTabWidget - this is instead done in the - \c quit() slot, before calling QApplication::quit() through a single-shot-timer, + name (accessible through the \c id property) is set to \c "From QAxFactory" + to indicate that this COM object has been created by COM. Note that there is + no destructor that would delete the QTabWidget - this is instead done in the + \c quit() slot, before calling QApplication::quit() through a single-shot-timer, which is necessary ensure that the COM call to the slot is complete. - \snippet examples/activeqt/comapp/main.cpp 6 + \snippet activeqt/comapp/main.cpp 6 The classes are exported from the server using the QAxFactory macros. Only \c Application objects can be instantiated from outside - the other APIs can only be used after accessing the respective objects throught the \c Application API. - \snippet examples/activeqt/comapp/main.cpp 7 + \snippet activeqt/comapp/main.cpp 7 The main() entry point function creates a QApplication, and just enters the event loop if the application has been started by COM. If the application - has been started by the user, then the \c Application object is created and + has been started by the user, then the \c Application object is created and the object name is set to "From Application". Then the COM server is started, and the application object is registered with COM. It is now accessible to COM clients through the client-specific APIs. - Application exiting is controlled explicitly - if COM started the application, + Application exiting is controlled explicitly - if COM started the application, then the client code has to call quit(); if the user started the application, then the application terminates when the last window has been closed. @@ -98,11 +98,11 @@ A simple Visual Basic application could now access this Qt application. In VB, start a new "Standard Exe" project and add a project reference to the comappLib - type library. Create a form with a listbox "DocumentList", a static label - "DocumentsCount" and a command button "NewDocument". Finally, implement the code + type library. Create a form with a listbox "DocumentList", a static label + "DocumentsCount" and a command button "NewDocument". Finally, implement the code for the form like this: - \snippet doc/src/snippets/code/doc_src_examples_activeqt_comapp.qdoc 0 + \snippet activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc 0 To build the example you must first build the QAxServer library. Then run \c qmake and your make tool in diff --git a/src/activeqt/doc/src/examples/hierarchy-demo-snippet.qdoc b/examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc index 9e62d2b..9e62d2b 100644 --- a/src/activeqt/doc/src/examples/hierarchy-demo-snippet.qdoc +++ b/examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc diff --git a/src/activeqt/doc/src/examples/hierarchy.qdoc b/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc index c3a65cd..de5dbf3 100644 --- a/src/activeqt/doc/src/examples/hierarchy.qdoc +++ b/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc @@ -40,49 +40,49 @@ control. The control is a QWidget subclass with child widgets that are accessible as sub-types. - \snippet examples/activeqt/hierarchy/objects.h 0 + \snippet activeqt/hierarchy/objects.h 0 The \c QParentWidget class provides slots to create a widget with a name, and to return a pointer to a named widget. The class declaration uses \c Q_CLASSINFO() to provide the COM identifiers for this class. - \snippet examples/activeqt/hierarchy/objects.cpp 0 + \snippet activeqt/hierarchy/objects.cpp 0 The constructor of QParentWidget creates a vertical box layout. New child widgets are automatically added to the layout. - \snippet examples/activeqt/hierarchy/objects.cpp 1 + \snippet activeqt/hierarchy/objects.cpp 1 The \c createSubWidget slot creates a new \c QSubWidget with the name provided in the parameter, and sets the label to that name. The widget is also shown explicitly. - \snippet examples/activeqt/hierarchy/objects.cpp 2 + \snippet activeqt/hierarchy/objects.cpp 2 The \c subWidget slot uses the \c QObject::child() function and returns the first child of type \c QSubWidget that has the requested name. - \snippet examples/activeqt/hierarchy/objects.h 1 + \snippet activeqt/hierarchy/objects.h 1 The \c QSubWidget class has a single string-property \c label, and implements the paintEvent to draw the label. The class uses again \c Q_CLASSINFO to provide the COM identifiers, and also sets the \e ToSuperClass attribute to \e QSubWidget, to ensure that only no slots of any superclasses (i.e. QWidget) are exposed. - \snippet examples/activeqt/hierarchy/objects.cpp 3 - \snippet examples/activeqt/hierarchy/objects.cpp 4 + \snippet activeqt/hierarchy/objects.cpp 3 + \snippet activeqt/hierarchy/objects.cpp 4 The implementation of the QSubWidget class is self-explanatory. - \snippet examples/activeqt/hierarchy/main.cpp 0 + \snippet activeqt/hierarchy/main.cpp 0 The classes are then exported using a QAxFactory. \c QParentWidget is exported as a full class (which can be created ), while \c QSubWidget is only exported as a type, which can only be created indirectly through APIs of \c QParentWidget. To build the example you must first build the QAxServer library. - Then run qmake and your make tool in \c examples/activeqt/hierarchy. + Then run qmake and your make tool in \c activeqt/hierarchy. The \l{qaxserver-demo-hierarchy.html}{demonstration} requires your WebBrowser to support ActiveX controls, and scripting to be enabled. - \snippet examples/hierarchy-demo-snippet.qdoc script + \snippet activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc script */ diff --git a/src/activeqt/doc/snippets/doc_src_examples_activeqt_menus.qdoc b/examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc index 39fd6d6..39fd6d6 100644 --- a/src/activeqt/doc/snippets/doc_src_examples_activeqt_menus.qdoc +++ b/examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc diff --git a/src/activeqt/doc/src/examples/menus.qdoc b/examples/activeqt/menus/doc/src/menus.qdoc index 1e62bb5..aa39019 100644 --- a/src/activeqt/doc/src/examples/menus.qdoc +++ b/examples/activeqt/menus/doc/src/menus.qdoc @@ -56,5 +56,5 @@ WebBrowser to support ActiveX controls, and scripting to be enabled. - \snippet doc/src/snippets/code/doc_src_examples_activeqt_menus.qdoc 0 + \snippet activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc 0 */ diff --git a/src/activeqt/doc/src/examples/multiple.qdoc b/examples/activeqt/multiple/doc/src/multiple.qdoc index 6707690..2f17d4b 100644 --- a/src/activeqt/doc/src/examples/multiple.qdoc +++ b/examples/activeqt/multiple/doc/src/multiple.qdoc @@ -42,19 +42,19 @@ The ActiveX controls in this example are simple QWidget subclasses that reimplement QWidget::paintEvent(). - \snippet examples/activeqt/multiple/ax1.h 0 + \snippet activeqt/multiple/ax1.h 0 The first control draws a filled rectangle. The fill color is exposed as a property. \c Q_CLASSINFO() is used to specify the COM identifiers. - \snippet examples/activeqt/multiple/ax2.h 0 + \snippet activeqt/multiple/ax2.h 0 The second control draws a circle. The linewith is exposed as a property. \c Q_CLASSINFO() is used to specify the COM identifiers, and to set the attributes \e ToSuperClass and \e StockEvents to expose only the API of the class itself, and to add COM stock events to the ActiveX control. - \snippet examples/activeqt/multiple/main.cpp 0 + \snippet activeqt/multiple/main.cpp 0 The classes are exported from the server using the QAxFactory macros. @@ -62,7 +62,7 @@ Then run \c qmake and your make tool in \c examples/activeqt/multiple. - The \l{qaxserver-demo-multiple.html}{demonstration} requires your + The \l{Two Simple Qt Widgets} demonstration requires your WebBrowser to support ActiveX controls, and scripting to be enabled. diff --git a/src/activeqt/doc/src/examples/opengl.qdoc b/examples/activeqt/opengl/doc/src/opengl.qdoc index d39b3b5..2396665 100644 --- a/src/activeqt/doc/src/examples/opengl.qdoc +++ b/examples/activeqt/opengl/doc/src/opengl.qdoc @@ -25,7 +25,7 @@ ** ****************************************************************************/ -/*! +/*! \page qaxserver-demo-opengl.html \title OpenGL in an HTML page @@ -71,48 +71,48 @@ Qt to render an OpenGL scene in an ActiveX. The control exposes a few methods to change the scene. - The application uses the default factory as provided by the - QAXFACTORY_DEFAULT macro to expose the \c GLBox widget as an ActiveX + The application uses the default factory as provided by the + QAXFACTORY_DEFAULT macro to expose the \c GLBox widget as an ActiveX control. - \snippet examples/activeqt/opengl/main.cpp 0 + \snippet activeqt/opengl/main.cpp 0 The implementation of \c main initializes the QApplication object, and uses \c QAxFactory::isServer() to determine whether or not it is appropriate to create and show the application interface. - \snippet examples/activeqt/opengl/main.cpp 1 - \snippet examples/activeqt/opengl/main.cpp 2 - \snippet examples/activeqt/opengl/main.cpp 3 + \snippet activeqt/opengl/main.cpp 1 + \snippet activeqt/opengl/main.cpp 2 + \snippet activeqt/opengl/main.cpp 3 The \c GLBox class inherits from both the \l QGLWidget class to be able to render OpenGL, and from \l QAxBindable. - \snippet examples/activeqt/opengl/glbox.h 0 + \snippet activeqt/opengl/glbox.h 0 The class reimplements the \l QAxBindable::createAggregate() function from QAxBindable to return the pointer to a \l QAxAggregated object. - \snippet examples/activeqt/opengl/glbox.h 1 + \snippet activeqt/opengl/glbox.h 1 The rest of the class declaration and the implementation of the OpenGL rendering is identical to the original "box" example. The implementation file of the \c GLBox class includes the \c objsafe.h system header, in which the \c IObjectSafety COM interface is defined. - \snippet examples/activeqt/opengl/glbox.cpp 0 + \snippet activeqt/opengl/glbox.cpp 0 A class \c ObjectSafetyImpl is declared using multiple inheritance to subclass the QAxAggregated class, and to implement the IObjectSafety interface. - \snippet examples/activeqt/opengl/glbox.cpp 1 + \snippet activeqt/opengl/glbox.cpp 1 The class declares a default constructor, and implements the queryInterface function to support the IObjectSafety interface. - \snippet examples/activeqt/opengl/glbox.cpp 2 + \snippet activeqt/opengl/glbox.cpp 2 Since every COM interface inherits \c IUnknown the \c QAXAGG_IUNKNOWN macro is used to provide the default implementation of the \c IUnknown interface. The macro is defined to delegate all calls to \c QueryInterface, \c AddRef and \c Release to the interface returned by the controllingUnknown() function. - \snippet examples/activeqt/opengl/glbox.cpp 3 + \snippet activeqt/opengl/glbox.cpp 3 The implementation of the \c IObjectSafety interface provides the caller - with information about supported and enabled safety options, and returns + with information about supported and enabled safety options, and returns \c S_OK for all calls to indicate that the ActiveX control is safe. - \snippet examples/activeqt/opengl/glbox.cpp 4 + \snippet activeqt/opengl/glbox.cpp 4 The implementation of the \c createAggregate() function just returns a new \c ObjectSafetyImpl object. - \snippet examples/activeqt/opengl/glbox.cpp 5 + \snippet activeqt/opengl/glbox.cpp 5 To build the example you must first build the QAxServer library. Then run \c qmake and your make tool in \c @@ -124,7 +124,7 @@ In contrast to the other QAxServer examples Internet Explorer will not open a dialog box to ask the user whether or not the scripting of the GLBox - control should be allowed (the exact browser behaviour depends on the security + control should be allowed (the exact browser behaviour depends on the security settings in the Internet Options dialog). \snippet doc/src/examples/opengl-demo.qdocinc 0 diff --git a/src/activeqt/doc/src/examples/qutlook.qdoc b/examples/activeqt/qutlook/doc/src/qutlook.qdoc index 57d572e..1842e80 100644 --- a/src/activeqt/doc/src/examples/qutlook.qdoc +++ b/examples/activeqt/qutlook/doc/src/qutlook.qdoc @@ -25,7 +25,7 @@ ** ****************************************************************************/ -/*! +/*! \example activeqt/qutlook \title Qutlook Example (ActiveQt) @@ -36,62 +36,62 @@ The project file for the example looks like this: - \snippet examples/activeqt/qutlook/qutlook.pro 1 - \snippet examples/activeqt/qutlook/qutlook.pro 2 + \snippet activeqt/qutlook/qutlook.pro 1 + \snippet 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 + 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 + \snippet 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 + \snippet 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 + \snippet 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 + \snippet activeqt/qutlook/addressview.cpp 2 The destructor logs off from the session. - \snippet examples/activeqt/qutlook/addressview.cpp 3 + \snippet 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 + \snippet activeqt/qutlook/addressview.cpp 4 The \c headerData() implementation returns hardcoded strings. - \snippet examples/activeqt/qutlook/addressview.cpp 5 + \snippet 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 + \snippet 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 + \snippet 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 + \snippet 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 + \snippet activeqt/qutlook/addressview.cpp 9 + \snippet 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 + \snippet activeqt/qutlook/main.cpp 0 The \c main() entry point function finally instantiates the user interface and enters the event loop. diff --git a/src/activeqt/doc/src/examples/simple.qdoc b/examples/activeqt/simple/doc/src/simple.qdoc index e92152b..761f8c3 100644 --- a/src/activeqt/doc/src/examples/simple.qdoc +++ b/examples/activeqt/simple/doc/src/simple.qdoc @@ -25,7 +25,7 @@ ** ****************************************************************************/ -/*! +/*! \page qaxserver-demo-simple.html \title A standard ActiveX and the "simple" ActiveQt widget @@ -78,7 +78,7 @@ QAxBindable::requestPropertyChange() and QAxBindable::propertyChanged(), and the use of the default QAxFactory through the \c QAXFACTORY_DEFAULT() macro. - + The ActiveX control in this example is a laid out QWidget with a QSlider, a QLCDNumber and a QLineEdit. It provides a signal/slot/property interface to change the values of the slider @@ -86,10 +86,10 @@ The Qt implementation of the ActiveX for this example is - \snippet examples/activeqt/simple/main.cpp 0 + \snippet activeqt/simple/main.cpp 0 The control is exported using the default QAxFactory - \snippet examples/activeqt/simple/main.cpp 1 + \snippet activeqt/simple/main.cpp 1 To build the example you must first build the QAxServer library. Then run qmake and your make tool in \c examples/activeqt/simple. diff --git a/src/activeqt/doc/src/examples/webbrowser.qdoc b/examples/activeqt/webbrowser/doc/src/webbrowser.qdoc index 06f7d95..7d79928 100644 --- a/src/activeqt/doc/src/examples/webbrowser.qdoc +++ b/examples/activeqt/webbrowser/doc/src/webbrowser.qdoc @@ -34,33 +34,33 @@ application. The user interface has been developed using the Qt Designer integration of the QAxWidget class. - The code demonstrates how the Qt application can communicate - with the embedded ActiveX controls using signals, slots and the + The code demonstrates how the Qt application can communicate + with the embedded ActiveX controls using signals, slots and the dynamicCall() function. - \snippet examples/activeqt/webbrowser/main.cpp 0 + \snippet activeqt/webbrowser/main.cpp 0 The \c MainWindow class declares a \c QMainWindow based user interface, using the \c Ui::MainWindow class generated by Qt Designer. A number - of slots are implemented to handle events from the various user + of slots are implemented to handle events from the various user interface elements, including the \c WebBrowser object, which is a QAxWidget hosting the Microsoft Web Browser control. - \snippet examples/activeqt/webbrowser/main.cpp 1 + \snippet activeqt/webbrowser/main.cpp 1 The constructor initializes the user interface, installs a progress bar on the status bar, and uses QAxBase::dynamicCall() to invoke the \c GoHome() method of Internet Explorer to navigate to the user's home page. - \snippet examples/activeqt/webbrowser/main.cpp 2 + \snippet activeqt/webbrowser/main.cpp 2 Different slots handle the signals emitted by the WebBrowser object. - Connections that don't require any coding, i.e. connecting the \c back + Connections that don't require any coding, i.e. connecting the \c back action to the \c GoBack() slot, have already been made in Qt Designer. - \snippet examples/activeqt/webbrowser/main.cpp 3 - \snippet examples/activeqt/webbrowser/main.cpp 4 + \snippet activeqt/webbrowser/main.cpp 3 + \snippet activeqt/webbrowser/main.cpp 4 The rest of the implementation is not related to ActiveQt - the actions are handled by different slots, and the entry point function starts the diff --git a/src/activeqt/doc/src/examples/wrapper.qdoc b/examples/activeqt/wrapper/doc/src/wrapper.qdoc index c453e3c..4e8eed3 100644 --- a/src/activeqt/doc/src/examples/wrapper.qdoc +++ b/examples/activeqt/wrapper/doc/src/wrapper.qdoc @@ -43,12 +43,12 @@ example are the standard button classes QPushButton, QCheckBox and QRadioButton as provided by Qt. - \snippet examples/activeqt/wrapper/main.cpp 0 + \snippet activeqt/wrapper/main.cpp 0 The factory implementation returns the list of supported controls, creates controls on request and provides information about the unique IDs of the COM classes and interfaces for each control. - \snippet examples/activeqt/wrapper/main.cpp 1 + \snippet activeqt/wrapper/main.cpp 1 The factory is exported using the QAXFACTORY_EXPORT macro. To build the example you must first build the QAxServer library. diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 5269bba..52f0169 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -705,7 +705,7 @@ QByteArray QAxEventSink::findProperty(DISPID dispID) the IDispatch interface, the properties and methods of that object become available as Qt properties and slots. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 0 + \snippet src_activeqt_container_qaxbase.cpp 0 Properties exposed by the object's IDispatch implementation can be read and written through the property system provided by the @@ -713,18 +713,18 @@ QByteArray QAxEventSink::findProperty(DISPID dispID) QObject::setProperty() and QObject::property()). Properties with multiple parameters are not supported. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 1 + \snippet src_activeqt_container_qaxbase.cpp 1 Write-functions for properties and other methods exposed by the object's IDispatch implementation can be called directly using dynamicCall(), or indirectly as slots connected to a signal. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 2 + \snippet src_activeqt_container_qaxbase.cpp 2 Outgoing events supported by the COM object are emitted as standard Qt signals. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 3 + \snippet src_activeqt_container_qaxbase.cpp 3 QAxBase transparently converts between COM data types and the equivalent Qt data types. Some COM types have no equivalent Qt data structure. @@ -841,11 +841,11 @@ QByteArray QAxEventSink::findProperty(DISPID dispID) To call the methods of a COM interface described by the following IDL - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 4 + \snippet src_activeqt_container_qaxbase.cpp 4 use the QAxBase API like this: - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 5 + \snippet src_activeqt_container_qaxbase.cpp 5 Note that the QList the object should fill has to be provided as an element in the parameter list of \l{QVariant}s. @@ -855,7 +855,7 @@ QByteArray QAxEventSink::findProperty(DISPID dispID) through its \c IDispatch implementation or other interfaces. Those interfaces can be retrieved through queryInterface(). - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 6 + \snippet src_activeqt_container_qaxbase.cpp 6 To get the definition of the COM interfaces you will have to use the header files provided with the component you want to use. Some compilers can also @@ -955,21 +955,21 @@ QAxMetaObject *QAxBase::internalMetaObject() const The most efficient way to set this property is by using the registered component's UUID, e.g. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 7 + \snippet src_activeqt_container_qaxbase.cpp 7 The second fastest way is to use the registered control's class name (with or without version number), e.g. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 8 + \snippet src_activeqt_container_qaxbase.cpp 8 The slowest, but easiest way to use is to use the control's full name, e.g. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 9 + \snippet src_activeqt_container_qaxbase.cpp 9 It is also possible to initialize the object from a file, e.g. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 10 + \snippet src_activeqt_container_qaxbase.cpp 10 If the component's UUID is used the following patterns can be used to initialize the control on a remote machine, to initialize a @@ -978,21 +978,21 @@ QAxMetaObject *QAxBase::internalMetaObject() const \li To initialize the control on a different machine use the following pattern: - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 11 + \snippet src_activeqt_container_qaxbase.cpp 11 \li To initialize a licensed control use the following pattern: - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 12 + \snippet src_activeqt_container_qaxbase.cpp 12 \li To connect to an already running object use the following pattern: - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 13 + \snippet src_activeqt_container_qaxbase.cpp 13 \endlist The first two patterns can be combined, e.g. to initialize a licensed control on a remote machine: - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 14 + \snippet src_activeqt_container_qaxbase.cpp 14 The control's read function always returns the control's UUID, if provided including the license key, and the name of the server, but not including the username, the domain or the password. @@ -1624,7 +1624,7 @@ private: } struct Method { - Method() : flags(0) + Method() : flags(0) {} QByteArray type; QByteArray parameters; @@ -1838,14 +1838,14 @@ void qax_deleteMetaObject(QMetaObject *metaObject) } MetaObjectGenerator::MetaObjectGenerator(QAxBase *ax, QAxBasePrivate *dptr) -: that(ax), d(dptr), disp(0), dispInfo(0), classInfo(0), typelib(0), +: that(ax), d(dptr), disp(0), dispInfo(0), classInfo(0), typelib(0), iidnames(QLatin1String("HKEY_LOCAL_MACHINE\\Software\\Classes"), QSettings::NativeFormat) { init(); } MetaObjectGenerator::MetaObjectGenerator(ITypeLib *tlib, ITypeInfo *tinfo) -: that(0), d(0), disp(0), dispInfo(tinfo), classInfo(0), typelib(tlib), +: that(0), d(0), disp(0), dispInfo(tinfo), classInfo(0), typelib(tlib), iidnames(QLatin1String("HKEY_LOCAL_MACHINE\\Software\\Classes"), QSettings::NativeFormat) { init(); @@ -2222,7 +2222,7 @@ void MetaObjectGenerator::readClassInfo() classInfo->GetImplTypeFlags(i, &typeFlags); if (typeFlags & IMPLTYPEFLAG_FSOURCE) continue; - + HREFTYPE hrefType; if (S_OK == classInfo->GetRefTypeOfImplType(i, &hrefType)) classInfo->GetRefTypeInfo(hrefType, &dispInfo); @@ -2231,7 +2231,7 @@ void MetaObjectGenerator::readClassInfo() dispInfo->GetTypeAttr(&ifaceAttr); WORD typekind = ifaceAttr->typekind; dispInfo->ReleaseTypeAttr(ifaceAttr); - + if (typekind & TKIND_DISPATCH) { break; } else { @@ -3475,7 +3475,7 @@ static bool checkHRESULT(HRESULT hres, EXCEPINFO *exc, QAxBase *that, const QStr qWarning(" Help : %s", help.toLatin1().data()); qWarning(" Connect to the exception(int,QString,QString,QString) signal to catch this exception"); } - } + } return false; case DISP_E_MEMBERNOTFOUND: qWarning("QAxBase: Error calling IDispatch member %s: Member not found", name.toLatin1().data()); @@ -4050,12 +4050,12 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & as the full prototype, for example as it would be written in a QObject::connect() call. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 15 + \snippet src_activeqt_container_qaxbase.cpp 15 Alternatively a function can be called passing the parameters embedded in the string, e.g. above function can also be invoked using - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 16 + \snippet src_activeqt_container_qaxbase.cpp 16 All parameters are passed as strings; it depends on the control whether they are interpreted correctly, and is slower than using the prototype @@ -4065,7 +4065,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & property. The property setter is called when \a var1 is a valid QVariant, otherwise the getter is called. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 17 + \snippet src_activeqt_container_qaxbase.cpp 17 Note that it is faster to get and set properties using QObject::property() and QObject::setProperty(). @@ -4084,7 +4084,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & queryInterface() to retrieve the appropriate COM interface, and use the function directly. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 18 + \snippet src_activeqt_container_qaxbase.cpp 18 This is also more efficient. */ @@ -4167,7 +4167,7 @@ QVariant QAxBase::dynamicCall(const char *function, QList<QVariant> &vars) certain elements of the application as dispatch interfaces. Use this method to navigate the hierarchy of the object model, e.g. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 19 + \snippet src_activeqt_container_qaxbase.cpp 19 */ QAxObject *QAxBase::querySubObject(const char *name, const QVariant &var1, @@ -4511,7 +4511,7 @@ void *qax_createObjectWrapper(int metaType, IUnknown *iface) values is turned around, ie. the last element of the array is the first parameter in the function. - \snippet doc/src/snippets/code/src_activeqt_container_qaxbase.cpp 20 + \snippet src_activeqt_container_qaxbase.cpp 20 Use this signal if the event has parameters of unsupported data types. Otherwise, connect directly to the signal \a name. diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp index 28ceed1..442aa41 100644 --- a/src/activeqt/container/qaxscript.cpp +++ b/src/activeqt/container/qaxscript.cpp @@ -91,27 +91,27 @@ class QAxScriptSite : public IActiveScriptSite, public IActiveScriptSiteWindow { public: QAxScriptSite(QAxScript *script); - + ULONG WINAPI AddRef(); ULONG WINAPI Release(); HRESULT WINAPI QueryInterface(REFIID iid, void **ppvObject); - + HRESULT WINAPI GetLCID(LCID *plcid); HRESULT WINAPI GetItemInfo(LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti); HRESULT WINAPI GetDocVersionString(BSTR *pbstrVersion); - + HRESULT WINAPI OnScriptTerminate(const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo); HRESULT WINAPI OnStateChange(SCRIPTSTATE ssScriptState); HRESULT WINAPI OnScriptError(IActiveScriptError *pscripterror); HRESULT WINAPI OnEnterScript(); HRESULT WINAPI OnLeaveScript(); - + HRESULT WINAPI GetWindow(HWND *phwnd); HRESULT WINAPI EnableModeless(BOOL fEnable); - + protected: QWidget *window() const; - + private: QAxScript *script; LONG ref; @@ -159,7 +159,7 @@ HRESULT WINAPI QAxScriptSite::QueryInterface(REFIID iid, void **ppvObject) *ppvObject = (IActiveScriptSiteWindow*)this; else return E_NOINTERFACE; - + AddRef(); return S_OK; } @@ -177,7 +177,7 @@ HRESULT WINAPI QAxScriptSite::GetLCID(LCID * /*plcid*/) /* Implements IActiveScriptSite::GetItemInfo - Tries to find the QAxBase for \a pstrName and returns the + Tries to find the QAxBase for \a pstrName and returns the relevant interfaces in \a item and \a type as requested through \a mask. */ HRESULT WINAPI QAxScriptSite::GetItemInfo(LPCOLESTR pstrName, DWORD mask, IUnknown **item, ITypeInfo **type) @@ -186,16 +186,16 @@ HRESULT WINAPI QAxScriptSite::GetItemInfo(LPCOLESTR pstrName, DWORD mask, IUnkno *item = 0; else if (mask & SCRIPTINFO_IUNKNOWN) return E_POINTER; - + if (type) *type = 0; else if (mask & SCRIPTINFO_ITYPEINFO) return E_POINTER; - + QAxBase *object = script->findObject(QString::fromWCharArray(pstrName)); if (!object) return TYPE_E_ELEMENTNOTFOUND; - + if (mask & SCRIPTINFO_IUNKNOWN) object->queryInterface(IID_IUnknown, (void**)item); if (mask & SCRIPTINFO_ITYPEINFO) { @@ -212,7 +212,7 @@ HRESULT WINAPI QAxScriptSite::GetItemInfo(LPCOLESTR pstrName, DWORD mask, IUnkno /* Implements IActiveScriptSite::GetDocVersionString - This method is not implemented. The scripting engine should assume + This method is not implemented. The scripting engine should assume that the script is in sync with the document. */ HRESULT WINAPI QAxScriptSite::GetDocVersionString(BSTR * /*version*/) @@ -229,11 +229,11 @@ HRESULT WINAPI QAxScriptSite::GetDocVersionString(BSTR * /*version*/) HRESULT WINAPI QAxScriptSite::OnScriptTerminate(const VARIANT *result, const EXCEPINFO *exception) { emit script->finished(); - + if (result && result->vt != VT_EMPTY) emit script->finished(VARIANTToQVariant(*result, 0)); if (exception) - emit script->finished(exception->wCode, + emit script->finished(exception->wCode, QString::fromWCharArray(exception->bstrSource), QString::fromWCharArray(exception->bstrDescription), QString::fromWCharArray(exception->bstrHelpFile) @@ -244,7 +244,7 @@ HRESULT WINAPI QAxScriptSite::OnScriptTerminate(const VARIANT *result, const EXC /* Implements IActiveScriptSite::OnEnterScript - Fires QAxScript::entered() to inform the host that the + Fires QAxScript::entered() to inform the host that the scripting engine has begun executing the script code. */ HRESULT WINAPI QAxScriptSite::OnEnterScript() @@ -256,7 +256,7 @@ HRESULT WINAPI QAxScriptSite::OnEnterScript() /* Implements IActiveScriptSite::OnLeaveScript - Fires QAxScript::finished() to inform the host that the + Fires QAxScript::finished() to inform the host that the scripting engine has returned from executing the script code. */ HRESULT WINAPI QAxScriptSite::OnLeaveScript() @@ -268,7 +268,7 @@ HRESULT WINAPI QAxScriptSite::OnLeaveScript() /* Implements IActiveScriptSite::OnScriptError - Fires QAxScript::error() to inform the host that an + Fires QAxScript::error() to inform the host that an that an execution error occurred while the engine was running the script. */ HRESULT WINAPI QAxScriptSite::OnScriptError(IActiveScriptError *error) @@ -280,7 +280,7 @@ HRESULT WINAPI QAxScriptSite::OnScriptError(IActiveScriptError *error) LONG charPos; BSTR bstrLineText; QString lineText; - + error->GetExceptionInfo(&exception); error->GetSourcePosition(&context, &lineNumber, &charPos); HRESULT hres = error->GetSourceLineText(&bstrLineText); @@ -293,7 +293,7 @@ HRESULT WINAPI QAxScriptSite::OnScriptError(IActiveScriptError *error) SysFreeString(exception.bstrHelpFile); emit script->error(exception.wCode, QString::fromWCharArray(exception.bstrDescription), lineNumber, lineText); - + return S_OK; } @@ -322,31 +322,31 @@ QWidget *QAxScriptSite::window() const w = qobject_cast<QWidget*>(p); p = p->parent(); } - + if (w) w = w->window(); if (!w && qApp) w = qApp->activeWindow(); - + return w; } /* Implements IActiveScriptSiteWindow::GetWindow - Retrieves the handle to a window that can act as the owner of a + Retrieves the handle to a window that can act as the owner of a pop-up window that the scripting engine must display. */ HRESULT WINAPI QAxScriptSite::GetWindow(HWND *phwnd) { if (!phwnd) return E_POINTER; - + *phwnd = 0; QWidget *w = window(); if (!w) return E_FAIL; - + // FIXME: 4.10.2011 Does this work with the parent's HWND? *phwnd = hwndForWidget(w); return S_OK; @@ -355,7 +355,7 @@ HRESULT WINAPI QAxScriptSite::GetWindow(HWND *phwnd) /* Implements IActiveScriptSiteWindow::EnableModeless - Causes the host to enable or disable its main window + Causes the host to enable or disable its main window as well as any modeless dialog boxes. */ HRESULT WINAPI QAxScriptSite::EnableModeless(BOOL fEnable) @@ -409,7 +409,7 @@ HRESULT WINAPI QAxScriptSite::EnableModeless(BOOL fEnable) /*! Constructs a QAxScriptEngine object interpreting script code in \a language - provided by the code in \a script. This is usually done by the QAxScript + provided by the code in \a script. This is usually done by the QAxScript class when \link QAxScript::load() loading a script\endlink. Instances of QAxScriptEngine should always have both a language and a @@ -421,7 +421,7 @@ QAxScriptEngine::QAxScriptEngine(const QString &language, QAxScript *script) #ifdef QT_CHECK_STATE if (language.isEmpty()) qWarning("QAxScriptEngine: created without language"); - + if (!script_code) qWarning("QAxScriptEngine: created without script"); #endif @@ -445,7 +445,7 @@ QAxScriptEngine::~QAxScriptEngine() #endif } -/*! +/*! \fn QString QAxScriptEngine::scriptLanguage() const Returns the scripting language, for example "VBScript", or "JScript". @@ -457,20 +457,20 @@ QAxScriptEngine::~QAxScriptEngine() bool QAxScriptEngine::initialize(IUnknown **ptr) { *ptr = 0; - + #ifndef QT_NO_QAXSCRIPT if (!script_code || script_language.isEmpty()) return false; - + CLSID clsid; HRESULT hres = CLSIDFromProgID((wchar_t*)script_language.utf16(), &clsid); if(FAILED(hres)) return false; - + CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IActiveScript, (void**)&engine); if (!engine) return false; - + IActiveScriptParse *parser = 0; engine->QueryInterface(IID_IActiveScriptParse, (void**)&parser); if (!parser) { @@ -478,7 +478,7 @@ bool QAxScriptEngine::initialize(IUnknown **ptr) engine = 0; return false; } - + if (engine->SetScriptSite(script_code->script_site) != S_OK) { engine->Release(); engine = 0; @@ -490,7 +490,7 @@ bool QAxScriptEngine::initialize(IUnknown **ptr) engine = 0; return false; } - + BSTR bstrCode = QStringToBSTR(script_code->scriptCode()); #ifdef Q_OS_WIN64 hres = parser->ParseScriptText(bstrCode, 0, 0, 0, DWORDLONG(this), 0, SCRIPTTEXT_ISVISIBLE, 0, 0); @@ -498,17 +498,17 @@ bool QAxScriptEngine::initialize(IUnknown **ptr) hres = parser->ParseScriptText(bstrCode, 0, 0, 0, DWORD(this), 0, SCRIPTTEXT_ISVISIBLE, 0, 0); #endif SysFreeString(bstrCode); - + parser->Release(); parser = 0; - + script_code->updateObjects(); - + if (engine->SetScriptState(SCRIPTSTATE_CONNECTED) != S_OK) { engine = 0; return false; } - + IDispatch *scriptDispatch = 0; engine->GetScriptDispatch(0, &scriptDispatch); if (scriptDispatch) { @@ -516,7 +516,7 @@ bool QAxScriptEngine::initialize(IUnknown **ptr) scriptDispatch->Release(); } #endif - + return *ptr != 0; } @@ -535,12 +535,12 @@ bool QAxScriptEngine::hasIntrospection() const { if (!isValid()) return false; - + IDispatch *scriptDispatch = 0; QAxBase::queryInterface(IID_IDispatch, (void**)&scriptDispatch); if (!scriptDispatch) return false; - + UINT tic = 0; HRESULT hres = scriptDispatch->GetTypeInfoCount(&tic); scriptDispatch->Release(); @@ -560,7 +560,7 @@ long QAxScriptEngine::queryInterface(const QUuid &uuid, void **iface) const *iface = 0; if (!engine) return E_NOTIMPL; - + #ifndef QT_NO_QAXSCRIPT return engine->QueryInterface(uuid, iface); #else @@ -577,7 +577,7 @@ QAxScriptEngine::State QAxScriptEngine::state() const { if (!engine) return Uninitialized; - + #ifndef QT_NO_QAXSCRIPT SCRIPTSTATE state; engine->GetScriptState(&state); @@ -596,7 +596,7 @@ void QAxScriptEngine::setState(State st) #ifndef QT_NO_QAXSCRIPT if (!engine) return; - + engine->SetScriptState((SCRIPTSTATE)st); #else Q_UNUSED(st); @@ -612,7 +612,7 @@ void QAxScriptEngine::addItem(const QString &name) #ifndef QT_NO_QAXSCRIPT if (!engine) return; - + engine->AddNamedItem((wchar_t*)name.utf16(), SCRIPTITEM_ISSOURCE|SCRIPTITEM_ISVISIBLE); #else Q_UNUSED(name); @@ -627,10 +627,10 @@ void QAxScriptEngine::addItem(const QString &name) Every instance of the QAxScript class represents a piece of scripting code in a particular scripting language. The code is loaded into the script engine using load(). Functions declared - in the code can be called using call(). + in the code can be called using call(). - The script provides scriptEngine() provides feedback to the - application through signals. The most important signal is the + The script provides scriptEngine() provides feedback to the + application through signals. The most important signal is the error() signal. Direct access to the QAxScriptEngine is provided through the scriptEngine() function. @@ -652,7 +652,7 @@ void QAxScriptEngine::addItem(const QString &name) /*! Constructs a QAxScript object called \a name and registers it with the QAxScriptManager \a manager. This is usually done by the - QAxScriptManager class when \link QAxScriptManager::load() loading a + QAxScriptManager class when \link QAxScriptManager::load() loading a script\endlink. A script should always have a name. A manager is necessary to allow @@ -665,10 +665,10 @@ script_engine(0) { if (manager) { manager->d->scriptDict.insert(name, this); - connect(this, SIGNAL(error(int,QString,int,QString)), + connect(this, SIGNAL(error(int,QString,int,QString)), manager, SLOT(scriptError(int,QString,int,QString))); } - + #ifndef QT_NO_QAXSCRIPT script_site = new QAxScriptSite(this); #else @@ -683,7 +683,7 @@ QAxScript::~QAxScript() { delete script_engine; script_engine = 0; - + #ifndef QT_NO_QAXSCRIPT script_site->Release(); #endif @@ -694,10 +694,10 @@ QAxScript::~QAxScript() into the script engine. Returns true if \a code was successfully entered into the script engine; otherwise returns false. - If \a language is empty (the default) it will be determined - heuristically. If \a code contains the string \c {End Sub} it will - be interpreted as VBScript, otherwise as JScript. Additional - scripting languages can be registered using + If \a language is empty (the default) it will be determined + heuristically. If \a code contains the string \c {End Sub} it will + be interpreted as VBScript, otherwise as JScript. Additional + scripting languages can be registered using QAxScript::registerEngine(). This function can only be called once for each QAxScript object, @@ -707,19 +707,19 @@ bool QAxScript::load(const QString &code, const QString &language) { if (script_engine || code.isEmpty()) return false; - + script_code = code; QString lang = language; if (lang.isEmpty()) { if (code.contains(QLatin1String("End Sub"), Qt::CaseInsensitive)) lang = QLatin1String("VBScript"); - + QList<QAxEngineDescriptor>::ConstIterator it; for (it = engines.begin(); it != engines.end(); ++it) { QAxEngineDescriptor engine = *it; if (engine.code.isEmpty()) continue; - + if (code.contains(engine.code)) { lang = engine.name; break; @@ -728,18 +728,18 @@ bool QAxScript::load(const QString &code, const QString &language) } if (lang.isEmpty()) lang = QLatin1String("JScript"); - + script_engine = new QAxScriptEngine(lang, this); // trigger call to initialize script_engine->metaObject(); - + return script_engine->isValid(); } /*! Returns a list of all the functions in this script if the respective script engine supports introspection; otherwise returns an empty list. - The functions are either provided with full prototypes or only as + The functions are either provided with full prototypes or only as names, depending on the value of \a flags. \sa QAxScriptEngine::hasIntrospection() @@ -747,7 +747,7 @@ bool QAxScript::load(const QString &code, const QString &language) QStringList QAxScript::functions(FunctionFlags flags) const { QStringList functions; - + const QMetaObject *mo = script_engine->metaObject(); for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { const QMetaMethod slot(mo->method(i)); @@ -756,21 +756,21 @@ QStringList QAxScript::functions(FunctionFlags flags) const QString slotname = QString::fromLatin1(slot.methodSignature()); if (slotname.contains(QLatin1Char('_'))) continue; - + if (flags == FunctionSignatures) functions << slotname; else functions << slotname.left(slotname.indexOf(QLatin1Char('('))); } - + return functions; } /*! - Calls \a function, passing the parameters \a var1, \a var1, + Calls \a function, passing the parameters \a var1, \a var1, \a var2, \a var3, \a var4, \a var5, \a var6, \a var7 and \a var8 - as arguments and returns the value returned by the function, or an - invalid QVariant if the function does not return a value or when + as arguments and returns the value returned by the function, or an + invalid QVariant if the function does not return a value or when the function call failed. See QAxScriptManager::call() for more information about how to call @@ -787,7 +787,7 @@ QVariant QAxScript::call(const QString &function, const QVariant &var1, { if (!script_engine) return QVariant(); - + return script_engine->dynamicCall(function.toLatin1(), var1, var2, var3, var4, var5, var6, var7, var8); } @@ -804,7 +804,7 @@ QVariant QAxScript::call(const QString &function, QList<QVariant> &arguments) { if (!script_engine) return QVariant(); - + return script_engine->dynamicCall(function.toLatin1(), arguments); } @@ -815,7 +815,7 @@ void QAxScript::updateObjects() { if (!script_manager) return; - + script_manager->updateScript(this); } @@ -826,7 +826,7 @@ QAxBase *QAxScript::findObject(const QString &name) { if (!script_manager) return 0; - + return script_manager->d->objectDict.value(name); } @@ -844,7 +844,7 @@ QAxBase *QAxScript::findObject(const QString &name) /*! \fn QAxScriptEngine* QAxScript::scriptEngine() const Returns a pointer to the script engine. - You can use the object returned to connect signals to the + You can use the object returned to connect signals to the script functions, or to access the script engine directly. */ @@ -899,9 +899,9 @@ QAxBase *QAxScript::findObject(const QString &name) and script code. \inmodule QAxContainer - The QAxScriptManager acts as a bridge between the COM objects embedded - in the Qt application through QAxObject or QAxWidget, and the scripting - languages available through the Windows Script technologies, usually JScript + The QAxScriptManager acts as a bridge between the COM objects embedded + in the Qt application through QAxObject or QAxWidget, and the scripting + languages available through the Windows Script technologies, usually JScript and VBScript. Create one QAxScriptManager for each separate document in your @@ -940,19 +940,19 @@ QAxScriptManager::~QAxScriptManager() Returns a list with all the functions that are available. Functions provided by script engines that don't support introspection are not included in the list. - The functions are either provided with full prototypes or + The functions are either provided with full prototypes or only as names, depending on the value of \a flags. */ QStringList QAxScriptManager::functions(QAxScript::FunctionFlags flags) const { QStringList functions; - + QHash<QString, QAxScript*>::ConstIterator scriptIt; for (scriptIt = d->scriptDict.begin(); scriptIt != d->scriptDict.end(); ++scriptIt) { QAxScript *script = scriptIt.value(); functions += script->functions(flags); } - + return functions; } @@ -962,19 +962,19 @@ QStringList QAxScriptManager::functions(QAxScript::FunctionFlags flags) const QStringList QAxScriptManager::scriptNames() const { QStringList scripts; - + QHash<QString, QAxScript*>::ConstIterator scriptIt; for (scriptIt = d->scriptDict.begin(); scriptIt != d->scriptDict.end(); ++scriptIt) { scripts << scriptIt.key(); } - + return scripts; } /*! Returns the script called \a name. - You can use the returned pointer to call functions directly + You can use the returned pointer to call functions directly through QAxScript::call(), to access the script engine directly, or to delete and thus unload the script. */ @@ -996,7 +996,7 @@ void QAxScriptManager::addObject(QAxBase *object) QString name = obj->objectName(); if (d->objectDict.contains(name)) return; - + d->objectDict.insert(name, object); connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*))); } @@ -1028,7 +1028,7 @@ void QAxScriptManager::addObject(QAxBase *object) before loading any scripts. If \a code declares a function that is already available (no matter in which language) the first function is overloaded and can no longer be called via call(); but it will - still be available by calling its \link script() script \endlink + still be available by calling its \link script() script \endlink directly. \sa addObject(), scriptNames(), functions() @@ -1038,7 +1038,7 @@ QAxScript *QAxScriptManager::load(const QString &code, const QString &name, cons QAxScript *script = new QAxScript(name, this); if (script->load(code, language)) return script; - + delete script; return 0; } @@ -1066,10 +1066,10 @@ QAxScript *QAxScriptManager::load(const QString &file, const QString &name) QByteArray data = f.readAll(); QString contents = QString::fromLocal8Bit(data, data.size()); f.close(); - + if (contents.isEmpty()) return 0; - + QString language; if (file.endsWith(QLatin1String(".js"))) { language = QLatin1String("JScript"); @@ -1079,46 +1079,46 @@ QAxScript *QAxScriptManager::load(const QString &file, const QString &name) QAxEngineDescriptor engine = *it; if (engine.extension.isEmpty()) continue; - + if (file.endsWith(engine.extension)) { language = engine.name; break; } } } - + if (language.isEmpty()) language = QLatin1String("VBScript"); - + QAxScript *script = new QAxScript(name, this); if (script->load(contents, language)) return script; - + delete script; return 0; } /*! - Calls \a function, passing the parameters \a var1, \a var1, + Calls \a function, passing the parameters \a var1, \a var1, \a var2, \a var3, \a var4, \a var5, \a var6, \a var7 and \a var8 - as arguments and returns the value returned by the function, or an - invalid QVariant if the function does not return a value or when + as arguments and returns the value returned by the function, or an + invalid QVariant if the function does not return a value or when the function call failed. The call returns when the script's execution has finished. In most script engines the only supported parameter type is "const QVariant&", for example, to call a JavaScript function - \snippet doc/src/snippets/code/src_activeqt_container_qaxscript.cpp 0 + \snippet src_activeqt_container_qaxscript.cpp 0 use - \snippet doc/src/snippets/code/src_activeqt_container_qaxscript.cpp 1 - As with \link QAxBase::dynamicCall() dynamicCall \endlink the + \snippet src_activeqt_container_qaxscript.cpp 1 + As with \link QAxBase::dynamicCall() dynamicCall \endlink the parameters can directly be embedded in the function string. - \snippet doc/src/snippets/code/src_activeqt_container_qaxscript.cpp 2 + \snippet src_activeqt_container_qaxscript.cpp 2 However, this is slower. Functions provided by script engines that don't support introspection are not available and must be called directly - using QAxScript::call() on the respective \link script() + using QAxScript::call() on the respective \link script() script \endlink object. Note that calling this function can be significantely slower than @@ -1141,7 +1141,7 @@ QVariant QAxScriptManager::call(const QString &function, const QVariant &var1, #endif return QVariant(); } - + return s->call(function, var1, var2, var3, var4, var5, var6, var7, var8); } @@ -1160,7 +1160,7 @@ QVariant QAxScriptManager::call(const QString &function, QList<QVariant> &argume #endif return QVariant(); } - + QList<QVariant> args(arguments); return s->call(function, args); } @@ -1177,17 +1177,17 @@ bool QAxScriptManager::registerEngine(const QString &name, const QString &extens { if (name.isEmpty()) return false; - + CLSID clsid; HRESULT hres = CLSIDFromProgID((wchar_t*)name.utf16(), &clsid); if (hres != S_OK) return false; - + QAxEngineDescriptor engine; engine.name = name; engine.extension = extension; engine.code = code; - + engines.prepend(engine); return true; } @@ -1201,18 +1201,18 @@ QString QAxScriptManager::scriptFileFilter() QString allFiles = QLatin1String("Script Files (*.js *.vbs *.dsm"); QString specialFiles = QLatin1String(";;VBScript Files (*.vbs *.dsm)" ";;JavaScript Files (*.js)"); - + QList<QAxEngineDescriptor>::ConstIterator it; for (it = engines.begin(); it != engines.end(); ++it) { QAxEngineDescriptor engine = *it; if (engine.extension.isEmpty()) continue; - + allFiles += QLatin1String(" *") + engine.extension; specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1Char(')'); } allFiles += QLatin1Char(')'); - + return allFiles + specialFiles + QLatin1String(";;All Files (*.*)"); } @@ -1233,7 +1233,7 @@ QString QAxScriptManager::scriptFileFilter() /*! \internal - Returns a pointer to the first QAxScript that knows + Returns a pointer to the first QAxScript that knows about \a function, or 0 if this function is unknown. */ QAxScript *QAxScriptManager::scriptForFunction(const QString &function) const @@ -1243,23 +1243,23 @@ QAxScript *QAxScriptManager::scriptForFunction(const QString &function) const QHash<QString, QAxScript*>::ConstIterator scriptIt; for (scriptIt = d->scriptDict.begin(); scriptIt != d->scriptDict.end(); ++scriptIt) { QAxScript *script = scriptIt.value(); - + if (script->functions(QAxScript::FunctionSignatures).contains(function)) return script; } } - + QString funcName = function; funcName = funcName.left(funcName.indexOf(QLatin1Char('('))); // second try, checking only names, not prototypes QHash<QString, QAxScript*>::ConstIterator scriptIt; for (scriptIt = d->scriptDict.begin(); scriptIt != d->scriptDict.end(); ++scriptIt) { QAxScript *script = scriptIt.value(); - + if (script->functions(QAxScript::FunctionNames).contains(funcName)) return script; } - + return 0; } @@ -1271,7 +1271,7 @@ void QAxScriptManager::updateScript(QAxScript *script) QHash<QString, QAxBase*>::ConstIterator objectIt; for (objectIt = d->objectDict.constBegin(); objectIt != d->objectDict.constEnd(); ++objectIt) { QString name = objectIt.key(); - + QAxScriptEngine *engine = script->scriptEngine(); if (engine) engine->addItem(name); diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp index d4b2ab7..abfdf76 100644 --- a/src/activeqt/container/qaxselect.cpp +++ b/src/activeqt/container/qaxselect.cpp @@ -51,7 +51,7 @@ class ControlList : public QAbstractListModel { public: ControlList(QObject *parent=0) - : QAbstractListModel(parent) + : QAbstractListModel(parent) { HKEY classes_key; RegOpenKeyEx(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &classes_key); @@ -102,7 +102,7 @@ public: int rowCount(const QModelIndex & = QModelIndex()) const { return controls.count(); } QVariant data(const QModelIndex &index, int role) const; - + private: QStringList controls; QMap<QString, QString> clsids; @@ -131,7 +131,7 @@ QVariant ControlList::data(const QModelIndex &index, int role) const components of the system and select one. The CLSID of the selected component can then be used in the application to e.g. initialize a QAxWidget: - \snippet doc/src/snippets/code/src_activeqt_container_qaxselect.cpp 0 + \snippet src_activeqt_container_qaxselect.cpp 0 \sa QAxWidget, {ActiveQt Framework} */ diff --git a/src/activeqt/control/qaxbindable.cpp b/src/activeqt/control/qaxbindable.cpp index ed4b938..e867eb8 100644 --- a/src/activeqt/control/qaxbindable.cpp +++ b/src/activeqt/control/qaxbindable.cpp @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE \l{moc}{meta-object compiler} requires you to inherit from QWidget first. - \snippet doc/src/snippets/code/src_activeqt_control_qaxbindable.cpp 0 + \snippet src_activeqt_control_qaxbindable.cpp 0 When implementing the property write function, use requestPropertyChange() to get permission from the ActiveX client @@ -107,7 +107,7 @@ QAxBindable::~QAxBindable() This function is usually called first in the write function for \a property, and writing is abandoned if the function returns false. - \snippet doc/src/snippets/code/src_activeqt_control_qaxbindable.cpp 1 + \snippet src_activeqt_control_qaxbindable.cpp 1 \sa propertyChanged() */ @@ -197,7 +197,7 @@ void QAxBindable::reportError(int code, const QString &src, const QString &desc, writeData(). The default implementation does nothing and returns false. - \warning ActiveX controls embedded in HTML can use either the + \warning ActiveX controls embedded in HTML can use either the \c type and \c data attribute of the \c object tag to read data, or use a list of \c param tags to initialize properties. If \c param tags are used, then Internet Explorer will ignore the @@ -271,7 +271,7 @@ bool QAxBindable::writeData(QIODevice *sink) support the interface \a iid. Note that you must cast the \c this pointer to the appropriate superclass. - \snippet doc/src/snippets/code/src_activeqt_control_qaxbindable.cpp 2 + \snippet src_activeqt_control_qaxbindable.cpp 2 Return the standard COM results \c S_OK (interface is supported) or \c E_NOINTERFACE (requested interface is not supported). @@ -290,7 +290,7 @@ bool QAxBindable::writeData(QIODevice *sink) delegate calls to \c QueryInterface(), \c AddRef(), and \c Release() to the interface provided by this function. - \snippet doc/src/snippets/code/src_activeqt_control_qaxbindable.cpp 3 + \snippet src_activeqt_control_qaxbindable.cpp 3 Instead of declaring and implementing these three functions manually, you can use the \c QAXAGG_IUNKNOWN macro in the class diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp index 0c92da0..6305cf8 100644 --- a/src/activeqt/control/qaxfactory.cpp +++ b/src/activeqt/control/qaxfactory.cpp @@ -64,20 +64,20 @@ extern wchar_t qAxModuleFilename[MAX_PATH]; the pure virtual functions in any implementation file (e.g. main.cpp), and export the factory using the \c QAXFACTORY_EXPORT() macro. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 0 + \snippet src_activeqt_control_qaxfactory.cpp 0 If you use the \c Q_CLASSINFO() macro to provide the unique identifiers or other attributes for your class you can use the \c QAXFACTORY_BEGIN(), \c QAXCLASS() and \c QAXFACTORY_END() macros to expose one or more classes as COM objects. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 1 + \snippet src_activeqt_control_qaxfactory.cpp 1 If your server supports just a single COM object, you can use a default factory implementation through the \c QAXFACTORY_DEFAULT() macro. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 2 + \snippet src_activeqt_control_qaxfactory.cpp 2 Only one QAxFactory implementation may be instantiated and exported by an ActiveX server application. This instance is accessible @@ -230,7 +230,7 @@ QUuid QAxFactory::eventsID(const QString &key) const e.g. implemented categories, can be added in an implementation of this function. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 3 + \snippet src_activeqt_control_qaxfactory.cpp 3 If you reimplement this function you must also reimplement unregisterClass() to remove the additional registry values. @@ -247,7 +247,7 @@ void QAxFactory::registerClass(const QString &key, QSettings *settings) const Unregisters any additional values for the class \a key from the system registry using the \a settings object. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 4 + \snippet src_activeqt_control_qaxfactory.cpp 4 \sa registerClass(), QSettings */ @@ -354,7 +354,7 @@ extern bool qAxIsServer; Returns true if the application has been started (by COM) as an ActiveX server, otherwise returns false. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 5 + \snippet src_activeqt_control_qaxfactory.cpp 5 */ bool QAxFactory::isServer() @@ -426,9 +426,9 @@ bool QAxFactory::isService() const The server is started automatically with \a type set to \c MultipleInstances if the server executable has been started with the \c -activex - command line parameter. To switch to SingleInstance, call - - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 6 + command line parameter. To switch to SingleInstance, call + + \snippet src_activeqt_control_qaxfactory.cpp 6 in your own main() entry point function. */ @@ -519,7 +519,7 @@ bool QAxFactory::registerActiveObject(QObject *object) and if the server is an executable server then it will have the application id \a AppID. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 7 + \snippet src_activeqt_control_qaxfactory.cpp 7 \sa QAXFACTORY_EXPORT(), QAXFACTORY_BEGIN() */ @@ -533,7 +533,7 @@ bool QAxFactory::registerActiveObject(QObject *object) and if the server is an executable server then it will have the application id \a AppID. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 8 + \snippet src_activeqt_control_qaxfactory.cpp 8 \sa QAXFACTORY_BEGIN() */ @@ -552,7 +552,7 @@ bool QAxFactory::registerActiveObject(QObject *object) This macro needs to be used together with the QAXCLASS(), QAXTYPE() and QAXFACTORY_END() macros. - \snippet doc/src/snippets/code/src_activeqt_control_qaxfactory.cpp 9 + \snippet src_activeqt_control_qaxfactory.cpp 9 */ /*! diff --git a/src/activeqt/doc/activeqt.qdocconf b/src/activeqt/doc/activeqt.qdocconf index eb60b7e..474792d 100644 --- a/src/activeqt/doc/activeqt.qdocconf +++ b/src/activeqt/doc/activeqt.qdocconf @@ -12,18 +12,23 @@ qhp.projects = ActiveQt qhp.ActiveQt.file = activeqt.qhp qhp.ActiveQt.namespace = org.qt-project.activeqt.500 qhp.ActiveQt.virtualFolder = activeqt -qhp.ActiveQt.indexTitle = ActiveQt +qhp.ActiveQt.indexTitle = Active Qt qhp.ActiveQt.indexRoot = qhp.ActiveQt.filterAttributes = activeqt 5.0.0 qtrefdoc qhp.ActiveQt.customFilters.Qt.name = activeqt 5.0.0 qhp.ActiveQt.customFilters.Qt.filterAttributes = activeqt 5.0.0 -qhp.ActiveQt.subprojects = classes -qhp.ActiveQt.subprojects.classes.title = C++ Classes -qhp.ActiveQt.subprojects.classes.indexTitle = Qt ActiveQt C++ Classes -qhp.ActiveQt.subprojects.classes.selectors = class fake:headerfile -qhp.ActiveQt.subprojects.classes.sortPages = true +qhp.ActiveQt.subprojects = qaxcontainerclasses qaxserverclasses +qhp.ActiveQt.subprojects.qaxcontainerclasses.title = QAxContainer C++ Classes +qhp.ActiveQt.subprojects.qaxcontainerclasses.indexTitle = QAxContainer C++ Classes +qhp.ActiveQt.subprojects.qaxcontainerclasses.selectors = class fake:headerfile +qhp.ActiveQt.subprojects.qaxcontainerclasses.sortPages = true + +qhp.ActiveQt.subprojects.qaxserverclasses.title = QAxServer C++ Classes +qhp.ActiveQt.subprojects.qaxserverclasses.indexTitle = QAxServer C++ Classes +qhp.ActiveQt.subprojects.qaxserverclasses.selectors = class fake:headerfile +qhp.ActiveQt.subprojects.qaxserverclasses.sortPages = true tagfile = ../../../doc/activeqt/activeqt.tags @@ -33,8 +38,7 @@ headerdirs += .. sourcedirs += .. -exampledirs += ../ \ +exampledirs += ../../../examples \ snippets imagedirs += images - diff --git a/src/activeqt/doc/src/qtaxbase.qdoc b/src/activeqt/doc/src/activeqt-index.qdoc index 60d33b9..70f65d5 100644 --- a/src/activeqt/doc/src/qtaxbase.qdoc +++ b/src/activeqt/doc/src/activeqt-index.qdoc @@ -32,27 +32,24 @@ These tools provide support for integrating Qt with ActiveX components. - \generatelist{related} - \sa {ActiveQt Framework} */ /*! - \page activeqt.html - \title Qt's ActiveX Framework (ActiveQt) - \brief An overview of Qt's ActiveX and COM integration on Windows. - + \page activeqt-index.html \ingroup qt-activex \keyword ActiveQt \target ActiveQt Framework + \title Active Qt + \brief Provides ActiveX and COM integration on Windows Qt's ActiveX and COM support allows Qt for Windows developers to: - \list 1 + \list \li Access and use ActiveX controls and COM objects provided by any ActiveX server in their Qt applications. \li Make their Qt applications available as COM servers, with - any number of Qt objects and widgets as COM objects and ActiveX + any number of Qt objects and widgets as COM objects and ActiveX controls. \endlist @@ -76,7 +73,7 @@ A set of \l{Tools for ActiveQt}{tools} is provided to simplify the developing and building of Qt projects that use ActiveX. - To build the static libraries, change into the \c activeqt directory + To build the static libraries, change into the \c activeqt directory (usually \c QTDIR/src/activeqt), and run \c qmake and your make tool in both the \c container and the \c control subdirectory. The libraries \c qaxcontainer.lib and \c qaxserver.lib will be linked @@ -87,8 +84,31 @@ plugin that integrates the QAxContainer module into \l{Qt Designer}. - The ActiveQt modules are part of the \l{Qt Commercial Edition} and - the \l{Open Source Versions of Qt}. + \section1 Articles and Guides + \list + \li \l{Tools for ActiveQt} + \li \l{Using ActiveX controls and COM in Qt} + \li \l{Building ActiveX servers in Qt} + \endlist + + \section1 Reference - \sa {QAxContainer Module}, {QAxServer Module} + \list + \li \l{QAxContainer C++ Classes} + \li \l{QAxServer C++ Classes} + \endlist + + \section1 Examples + \list + \li \l{Multiple Example (ActiveQt)} + \li \l{Qutlook Example (ActiveQt)} + \li \l{COM App Example (ActiveQt)} + \li \l{Dot Net Example (ActiveQt)} + \li \l{OpenGL Example (ActiveQt)} + \li \l{Hierarchy Example (ActiveQt)} + \li \l{Menus Example (ActiveQt)} + \li \l{Wrapper Example (ActiveQt)} + \li \l{Simple Example (ActiveQt)} + \li \l{Web Browser Example (ActiveQt)} + \endlist */ diff --git a/src/activeqt/doc/src/examples/dotnet.qdoc b/src/activeqt/doc/src/examples/dotnet.qdoc index 2915422..fc66b4f 100644 --- a/src/activeqt/doc/src/examples/dotnet.qdoc +++ b/src/activeqt/doc/src/examples/dotnet.qdoc @@ -97,7 +97,7 @@ \b{Remark:} You will notice that in the generated code the following line is commented out: - \snippet doc/src/snippets/code/doc_src_examples_activeqt_dotnet.qdoc 0 + \snippet doc_src_examples_activeqt_dotnet.qdoc 0 This line is regenerated without comment whenever you change the dialog, in which case you have to comment it out again to be able @@ -114,14 +114,14 @@ managed .NET application, whether written in C#, VB.NET, MC++ or other managed programming language. - \snippet examples/activeqt/dotnet/wrapper/lib/worker.h 0 + \snippet activeqt/dotnet/wrapper/lib/worker.h 0 The Qt class has nothing unusual for Qt users, and as even the Qt specialities like \c Q_PROPERTY, \c slots and \c signals are implemented with straight C++ they don't cause any trouble when compiling this class with any C++ compiler. - \snippet examples/activeqt/dotnet/wrapper/lib/networker.h 0 + \snippet activeqt/dotnet/wrapper/lib/networker.h 0 The .NET wrapper class uses keywords that are part of MC++ to indicate that the class is managed/garbage collected (\c {__gc}), and that \c @@ -155,21 +155,21 @@ to the String object, even if it has been moved by the garbage collector, and it can be used just like a normal pointer. - \snippet examples/activeqt/dotnet/wrapper/lib/tools.cpp 0 + \snippet activeqt/dotnet/wrapper/lib/tools.cpp 0 \codeline - \snippet examples/activeqt/dotnet/wrapper/lib/tools.cpp 1 + \snippet activeqt/dotnet/wrapper/lib/tools.cpp 1 The convertor functions can then be used in the wrapper class implementation to call the functions in the native C++ class. - \snippet examples/activeqt/dotnet/wrapper/lib/networker.cpp 0 + \snippet activeqt/dotnet/wrapper/lib/networker.cpp 0 \codeline - \snippet examples/activeqt/dotnet/wrapper/lib/networker.cpp 1 + \snippet activeqt/dotnet/wrapper/lib/networker.cpp 1 The constructor and destructor simply create and destroy the Qt object wrapped using the C++ operators \c new and \c delete. - \snippet examples/activeqt/dotnet/wrapper/lib/networker.cpp 2 + \snippet activeqt/dotnet/wrapper/lib/networker.cpp 2 The netWorker class delegates calls from the .NET code to the native code. Although the transition between those two worlds implies a small @@ -177,7 +177,7 @@ this should be negligible since we are anyway going to run within the CLR. - \snippet examples/activeqt/dotnet/wrapper/lib/networker.cpp 3 + \snippet activeqt/dotnet/wrapper/lib/networker.cpp 3 The property setter calls the native Qt class before firing the event using the \c __raise keyword. @@ -185,10 +185,10 @@ This wrapper class can now be used in .NET code, e.g. using C++, C#, Visual Basic or any other programming language available for .NET. - \snippet examples/activeqt/dotnet/wrapper/main.cs 0 - \snippet examples/activeqt/dotnet/wrapper/main.cs 1 - \snippet examples/activeqt/dotnet/wrapper/main.cs 2 - \snippet examples/activeqt/dotnet/wrapper/main.cs 3 + \snippet activeqt/dotnet/wrapper/main.cs 0 + \snippet activeqt/dotnet/wrapper/main.cs 1 + \snippet activeqt/dotnet/wrapper/main.cs 2 + \snippet activeqt/dotnet/wrapper/main.cs 3 \section1 Walkthrough: .NET/COM Interop with ActiveQt @@ -266,7 +266,7 @@ the event handler \c circleClicked for the \c ClickEvent to increase the line width by one for every click: - \snippet examples/activeqt/dotnet/walkthrough/Form1.cs 0 + \snippet activeqt/dotnet/walkthrough/Form1.cs 0 In general we can implement a default event handler by double clicking on the widget in the form, but the default events for @@ -276,7 +276,7 @@ emitted by QPushButton. Add the event handler \c resetLineWidth to the \c clicked event, and implement the generated function: - \snippet examples/activeqt/dotnet/walkthrough/Form1.cs 1 + \snippet activeqt/dotnet/walkthrough/Form1.cs 1 We reset the property to 1, and also call the \c setFocus() slot to simulate the user style on Windows, where a button grabs focus diff --git a/src/activeqt/doc/src/qtaxcontainer.qdoc b/src/activeqt/doc/src/qtaxcontainer.qdoc index 0162e26..d8d6441 100644 --- a/src/activeqt/doc/src/qtaxcontainer.qdoc +++ b/src/activeqt/doc/src/qtaxcontainer.qdoc @@ -24,6 +24,58 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +/*! + \module QAxContainer + \title QAxContainer C++ Classes + \ingroup modules + + \brief The QAxContainer module is a Windows-only extension for + accessing ActiveX controls and COM objects. + + QAxServer is part of the \l{Active Qt} module. + The \l{Using ActiveX controls and COM in Qt} page contains information about + containers for ActiveX controls. + + \section1 License Information + + The QAxContainer module is not covered by the \l{GNU General Public License (GPL)}, + the \l{GNU Lesser General Public License (LGPL)}, or the + \l{Qt Commercial License}. Instead, it is distributed under + the following license. + + \legalese + Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).\br + Contact: http://www.qt-project.org/legal\br + + You may use this file under the terms of the BSD license as follows: + + "Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names + of its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + \endlegalese +*/ /*! \page activeqt-container.html @@ -67,7 +119,7 @@ To build Qt applications that can host COM objects and ActiveX controls link the application against the QAxContainer module by adding - \snippet doc/src/snippets/code/doc_src_qaxcontainer.pro 0 + \snippet doc_src_qaxcontainer.pro 0 to your application's \c .pro file. @@ -82,7 +134,7 @@ \section1 Instantiating COM Objects To instantiate a COM object use the QAxBase::setControl() API, or pass - the name of the object directly into the constructor of the QAxBase + the name of the object directly into the constructor of the QAxBase subclass you are using. The control can be specified in a variety of formats, but the fastest @@ -94,7 +146,7 @@ \section2 Typical Error Messages ActiveQt prints error messages to the debug output when it - encounters error situations at runtime. Usually you must run + encounters error situations at runtime. Usually you must run your program in the debugger to see these messages (e.g. in Visual Studio's Debug output). @@ -128,7 +180,7 @@ want to use, or integrate it into the build system by adding the type libraries to the \c TYPELIBS variable in your application's \c .pro file: - \snippet doc/src/snippets/code/doc_src_qaxcontainer.pro 1 + \snippet doc_src_qaxcontainer.pro 1 Note that \l dumpcpp might not be able to expose all APIs in the type library. @@ -141,8 +193,8 @@ Use QAxBase::dynamicCall() and QAxBase::querySubObject() as well as the QObject::setProperty() and QObject::property() APIs to call the - methods and properties of the COM object through their name. Use the - \l dumpdoc tool to get the documentation of the Qt API for any COM + methods and properties of the COM object through their name. Use the + \l dumpdoc tool to get the documentation of the Qt API for any COM object and its subobjects; note that not all of the COM object's APIs might be available. @@ -154,12 +206,12 @@ The script engine can then run script code that accesses the COM objects. To instantiate a script engine, use QAxScriptManager::addObject() to - register the COM objects you want to access from script, and + register the COM objects you want to access from script, and QAxScriptManager::load() to load the script code into the engine. Then - call the script functions using QAxScriptManager::call() or + call the script functions using QAxScriptManager::call() or QAxScript::call(). - Which APIs of the COM object are available through scripting depends on + Which APIs of the COM object are available through scripting depends on the script language used. The \l{testcon - An ActiveX Test Container (ActiveQt)}{ActiveX Test Container} @@ -168,7 +220,7 @@ \section2 Calling a Function Using the Native COM Interfaces To call functions of the COM object that can not be accessed via any - of the above methods it is possible to request the COM interface directly + of the above methods it is possible to request the COM interface directly using QAxBase::queryInterface(). To get a C++ definition of the respective interface classes use the \c #import directive with the type library provided with the control; see your compiler manual for details. @@ -176,7 +228,7 @@ \section2 Typical Error Messages ActiveQt prints error messages to the debug output when it - encounters error situations at runtime. Usually you must run + encounters error situations at runtime. Usually you must run your program in the debugger to see these messages (e.g. in Visual Studio's Debug output). @@ -193,13 +245,13 @@ \section3 Error calling IDispatch member: Type mismatch in parameter n A QAxBase::dynamicCall() failed - the function prototype was correct, - but the paramter at index \c n was of the wrong type and could + but the paramter at index \c n was of the wrong type and could not be coerced to the correct type. \section3 QAxScriptManager::call(): No script provides this function You try to call a function that is provided through an engine - that doesn't provide introspection (ie. ActivePython or + that doesn't provide introspection (ie. ActivePython or ActivePerl). You need to call the function directly on the respective QAxScript object. */ diff --git a/src/activeqt/doc/src/qtaxserver.qdoc b/src/activeqt/doc/src/qtaxserver.qdoc index 285a74c..eb1b2f0 100644 --- a/src/activeqt/doc/src/qtaxserver.qdoc +++ b/src/activeqt/doc/src/qtaxserver.qdoc @@ -26,6 +26,59 @@ ****************************************************************************/ /*! + \module QAxServer + \title QAxServer C++ Classes + \ingroup modules + + \brief The QAxServer module is a Windows-only static library that + you can use to turn a standard Qt binary into a COM server. + + QAxServer is part of the \l{Active Qt} module. The + \l{Building ActiveX servers in Qt} page contains information about + turning a Qt binary into a COM server + + \section1 License Information + + The QAxContainer module is not covered by the \l{GNU General Public License (GPL)}, + the \l{GNU Lesser General Public License (LGPL)}, or the + \l{Qt Commercial License}. Instead, it is distributed under + the following license. + + \legalese + Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).\br + Contact: http://www.qt-project.org/legal\br + + You may use this file under the terms of the BSD license as follows: + + "Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names + of its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + \endlegalese +*/ + +/*! \page activeqt-server.html \title Building ActiveX servers in Qt \ingroup qt-activex @@ -60,10 +113,10 @@ An out-of-process executable server is generated from a \c .pro file like this: - \snippet doc/src/snippets/code/doc_src_qaxserver.pro 0 + \snippet doc_src_qaxserver.pro 0 To build an in-process server, use a \c .pro file like this: - \snippet doc/src/snippets/code/doc_src_qaxserver.pro 1 + \snippet doc_src_qaxserver.pro 1 The files \c qaxserver.rc and \c qaxserver.def are part of the framework and can be used from their usual location (specify a @@ -91,7 +144,7 @@ Additionally you can specify a version number using the \c VERSION variable, e.g. - \snippet doc/src/snippets/code/doc_src_qaxserver.pro 2 + \snippet doc_src_qaxserver.pro 2 The version number specified will be used as the version of the type library and of the server when registering. @@ -100,7 +153,7 @@ Whether your COM server should run as a stand-alone executable or as a shared library in the client process depends mainly on the - type of COM objects you want to provide in the server. + type of COM objects you want to provide in the server. An executable server has the advantage of being able to run as a stand-alone application, but adds considerable overhead to the @@ -113,7 +166,7 @@ time. The communication between client and server is done directly through virtual function calls and does not introduce the overhead required for remote procedure calls. However, if the server crashes the - client application is likely to crash as well, and not every + client application is likely to crash as well, and not every functionality is available for in-process servers (i.e. register in the COM's running-object-table). @@ -122,7 +175,7 @@ \section2 Typical Errors During the Post-Build Steps - For the ActiveQt specific post-processing steps to work the + For the ActiveQt specific post-processing steps to work the server has to meet some requirements: \list @@ -131,19 +184,19 @@ \li The initial linking of the server includes a temporary type library resource \li All dependencies required to run the server are in the system path - (or in the path used by the calling environment; note that Visual + (or in the path used by the calling environment; note that Visual Studio has its own set of environment variables listed in the Tools|Options|Directories dialog). \endlist - If those requirements are not met one ore more of the following + If those requirements are not met one ore more of the following errors are likely to occur: \section3 The Server Executable Crashes To generate the IDL the widgets exposed as ActiveX controls need to - be instantiated (the constructor is called). At this point, nothing - else but a QApplication object exists. Your widget constructor must + be instantiated (the constructor is called). At this point, nothing + else but a QApplication object exists. Your widget constructor must not rely on any other objects to be created, e.g. it should check for null-pointers. @@ -186,26 +239,26 @@ or any existing QObject subclass. If the class is a subclass of QWidget, the COM object will be an ActiveX control. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 3 + \snippet doc_src_qaxserver.cpp 3 The Q_OBJECT macro is required to provide the meta object information about the widget to the ActiveQt framework. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 4 + \snippet doc_src_qaxserver.cpp 4 Use the Q_CLASSINFO() macro to specify the COM identifiers for the COM object. \c ClassID and \c InterfaceID are required, while \c EventsID is only necessary when your object has signals. To generate these identifiers, use system tools like \c uuidgen or \c guidgen. - You can specify additional attributes for each of your classes; see + You can specify additional attributes for each of your classes; see \l{Class Information and Tuning} for details. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 5 + \snippet doc_src_qaxserver.cpp 5 Use the Q_PROPERTY() macro to declare properties for the ActiveX control. - Declare a standard constructor taking a parent object, and functions, + Declare a standard constructor taking a parent object, and functions, signals and slots like for any QObject subclass. \footnote If a standard constructor is not present the compiler will issue @@ -216,9 +269,9 @@ your implementation of QAxFactory::create. \endfootnote - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 6 + \snippet doc_src_qaxserver.cpp 6 - The ActiveQt framework will expose properties and public slots as ActiveX + The ActiveQt framework will expose properties and public slots as ActiveX properties and methods, and signals as ActiveX events, and convert between the Qt data types and the equivalent COM data types. @@ -273,8 +326,8 @@ COM cannot marshal IPictureDisp accross process boundaries, so QPixmap properties cannot be called for out-of-process servers. You can however marshal the image data via e.g. temporary files. See the - Microsoft - \link http://support.microsoft.com/default.aspx?scid=kb;[LN];Q150034 KB article + Microsoft + \link http://support.microsoft.com/default.aspx?scid=kb;[LN];Q150034 KB article Q150034 \endlink for more information. \endfootnote \row @@ -393,7 +446,7 @@ \row \li QRect& \footnote - OLE needs to marshal user defined types by reference (ByRef), and cannot + OLE needs to marshal user defined types by reference (ByRef), and cannot marshal them by value (ByVal). This is why const-references and object parameters are not supported for QRect, QSize and QPoint. \endfootnote @@ -416,7 +469,7 @@ \section2 Sub-Objects COM objects can have multiple sub-objects that can represent a sub element - of the COM object. A COM object representing a multi-document spread sheet + of the COM object. A COM object representing a multi-document spread sheet application can for example provide one sub-object for each spread sheet. Any QObject subclass can be used as the type for a sub object in ActiveX, as @@ -428,38 +481,38 @@ To make the properties bindable for the ActiveX client, use multiple inheritance from the QAxBindable class: - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 7 + \snippet doc_src_qaxserver.cpp 7 When implementing the property write functions, use the QAxBindable class's requestPropertyChange() and propertyChanged() functions to allow ActiveX clients to bind to the control - properties. - \footnote - This is not required, but gives the client more control over + properties. + \footnote + This is not required, but gives the client more control over the ActiveX control. \endfootnote \section1 Serving Controls - To make a COM server available to the COM system it must be registered - in the system registry using five unique identifiers. - These identifiers are provided by tools like \c guidgen or \c uuidgen. - The registration information allows COM to localize the binary providing - a requested ActiveX control, marshall remote procedure calls to the - control and read type information about the methods and properties exposed + To make a COM server available to the COM system it must be registered + in the system registry using five unique identifiers. + These identifiers are provided by tools like \c guidgen or \c uuidgen. + The registration information allows COM to localize the binary providing + a requested ActiveX control, marshall remote procedure calls to the + control and read type information about the methods and properties exposed by the control. - To create the COM object when the client asks for it the server must export + To create the COM object when the client asks for it the server must export an implementation of a QAxFactory. The easist way to do this is to use a set of macros: - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 8 + \snippet doc_src_qaxserver.cpp 8 This will export \c MyWidget and \c MyWidget2 as COM objects that can be created by COM clients, and will register \c MySubType as a type that can be used in properties and parameters of \c MyWidget and \c MyWidget2. - The \link QAxFactory QAxFactory class documentation \endlink explains + The \link QAxFactory QAxFactory class documentation \endlink explains how to use this macro, and how to implement and use custom factories. For out-of-process executable servers you can implement a main() @@ -470,7 +523,7 @@ server. Use QAxFactory::isServer() to create and run a standard application interface, or to prevent a stand-alone execution: - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 9 + \snippet doc_src_qaxserver.cpp 9 This is however not necessary as ActiveQt provides a default implementation of a main function. The default implemenation calls QAxFactory::startServer(), @@ -498,7 +551,7 @@ \section2 Typical Compile-Time Problems - The compiler/linker errors listed are based on those issued by the + The compiler/linker errors listed are based on those issued by the Microsoft Visual C++ 6.0 compiler. \section3 "No overloaded function takes 2 parameters" @@ -512,13 +565,13 @@ macro, the QAxFactory subclass had no appropriate constructor. Provide a public class constructor like - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 10 + \snippet doc_src_qaxserver.cpp 10 for your factory class. \section3 "Syntax error: bad suffix on number" - The unique identifiers have not been passed as strings into the + The unique identifiers have not been passed as strings into the QAXFACTORY_EXPORT() or QAXFACTORY_DEFAULT() macro. \section3 "Unresolved external symbol _ucm_instantiate" @@ -560,7 +613,7 @@ your installer process, resolve the \c DllRegisterServer symbol and call the function: - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 11 + \snippet doc_src_qaxserver.cpp 11 \section3 Distributing Servers over the Internet @@ -578,11 +631,11 @@ other Online resources. The examples include INF files that can be used to build CAB archives: - \snippet examples/activeqt/simple/simple.inf 0 + \snippet activeqt/simple/simple.inf 0 The CABARC tool from Microsoft can easily generate CAB archives: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 12 + \snippet doc_src_qaxserver.qdoc 12 The INF files assume a static build of Qt, so no dependencies to other DLLs are listed in the INF files. To distribute an ActiveX server depending on @@ -592,13 +645,13 @@ \section1 Using the Controls To use the ActiveX controls, e.g. to embed them in a web page, use - the \c <object> HTML tag. + the \c <object> HTML tag. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 13 + \snippet doc_src_qaxserver.qdoc 13 To initialize the control's properties, use - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 14 + \snippet doc_src_qaxserver.qdoc 14 If the web browser supports scripting use JavaScript, VBScript and forms to script the control. The @@ -612,7 +665,7 @@ \section3 Supported Clients - These standard applications work with ActiveX controls developed with + These standard applications work with ActiveX controls developed with ActiveQt. Note that some clients support only in-process controls. \list @@ -647,8 +700,8 @@ If the system is unable to start the server (check with the task manager whether the server runs a process), make sure that no DLL - the server depends on is missing from the system path (e.g. the Qt - DLL!). Use a dependency walker to view all dependencies of the server + the server depends on is missing from the system path (e.g. the Qt + DLL!). Use a dependency walker to view all dependencies of the server binary. If the server runs (e.g. the task manager lists a process), see @@ -657,7 +710,7 @@ \section3 The Object Cannot Be Created If the server could be built and registered correctly during the build - process, but the object cannot be initiliazed e.g. by the OLE/COM Object + process, but the object cannot be initiliazed e.g. by the OLE/COM Object Viewer application, make sure that no DLL the server depends on is missing from the system path (e.g. the Qt DLL). Use a dependency walker to view all dependencies of the server binary. @@ -667,16 +720,16 @@ \section2 Debugging Runtime Errors - To debug an in-process server in Visual Studio, set the server project + To debug an in-process server in Visual Studio, set the server project as the active project, and specify a client "executable for debug - session" in the project settings (e.g. use the ActiveX Test Container). - You can set breakpoints in your code, and also step into ActiveQt and + session" in the project settings (e.g. use the ActiveX Test Container). + You can set breakpoints in your code, and also step into ActiveQt and Qt code if you installed the debug version. To debug an executable server, run the application in a debugger and start with the command line parameter \c -activex. Then start - your client and create an instance of your ActiveX control. COM - will use the existing process for the next client trying to create + your client and create an instance of your ActiveX control. COM + will use the existing process for the next client trying to create an ActiveX control. \section1 Class Information and Tuning @@ -731,7 +784,7 @@ \row \li Insertable \li If the value is "yes" the class is registered to be "Insertable" - and will be listed in OLE 2 containers (ie. Microsoft Office). This + and will be listed in OLE 2 containers (ie. Microsoft Office). This attribute is not be set by default. \row \li Aggregatable @@ -751,12 +804,12 @@ \row \li MIME \li The object can handle data and files of the format specified in the - value. The value has the format mime:extension:description. Multiple + value. The value has the format mime:extension:description. Multiple formats are separated by a semicolon. \row \li CoClassAlias \li The classname used in the generated IDL and in the registry. This is - esp. useful for C++ classes that live in a namespace - by default, + esp. useful for C++ classes that live in a namespace - by default, ActiveQt just removes the "::" to make the IDL compile. \endtable @@ -766,13 +819,13 @@ own API, and is available in the "Insert Objects" dialog of Microsoft Office applications. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 15 + \snippet doc_src_qaxserver.cpp 15 \section2 Developing Licensed Components If you develop components you might want to control who is able to instantiate - those components. Since the server binary can be shipped to and registered on - any client machine it is possible for anybody to use those components in his + those components. Since the server binary can be shipped to and registered on + any client machine it is possible for anybody to use those components in his own software. Licensing components can be done using a variety of techniques, e.g. the code @@ -782,35 +835,35 @@ To mark a Qt class as licensed specify a "LicenseKey" using the Q_CLASSINFO() macro. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 16 + \snippet doc_src_qaxserver.cpp 16 The key is required to be able to create an instance of \c MyLicensedControl - on a machine that is not licensed itself. The licensed developer can now - redistributes the server binary with his application, which creates the control + on a machine that is not licensed itself. The licensed developer can now + redistributes the server binary with his application, which creates the control using the value of "LicenseKey", while users of the application cannot create the control without the license key. - If a single license key for the control is not sufficient (ie. you want - differnet developers to receive different license keys) you can specify an - empty key to indicate that the control requires a license, and reimplement - \l QAxFactory::validateLicenseKey() to verify that a license exists on the + If a single license key for the control is not sufficient (ie. you want + differnet developers to receive different license keys) you can specify an + empty key to indicate that the control requires a license, and reimplement + \l QAxFactory::validateLicenseKey() to verify that a license exists on the system (ie. through a license file). \section2 More Interfaces - ActiveX controls provided by ActiveQt servers support a minimal set of COM - interfaces to implement the OLE specifications. When the ActiveX class inherits + ActiveX controls provided by ActiveQt servers support a minimal set of COM + interfaces to implement the OLE specifications. When the ActiveX class inherits from the QAxBindable class it can also implement additional COM interfaces. Create a new subclass of QAxAggregated and use multiple inheritance - to subclass additional COM interface classes. + to subclass additional COM interface classes. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 17 + \snippet doc_src_qaxserver.cpp 17 Reimplement the QAxAggregated::queryInterface() function to support the additional COM interfaces. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 18 + \snippet doc_src_qaxserver.cpp 18 Since \c ISomeCOMInterface is a subclass of \c IUnknown you will have to implement the \c QueryInterface(), \c AddRef(), and \c @@ -820,7 +873,7 @@ returned by the QAxAggregated::controllingUnknown() function, e.g. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 19 + \snippet doc_src_qaxserver.cpp 19 Do not support the \c IUnknown interface itself in your \l{QAxAggregated::queryInterface()}{queryInterface()} @@ -833,5 +886,5 @@ QAxBindable::createAggregate() to return a new object of the QAxAggregated subclass. - \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 20 + \snippet doc_src_qaxserver.cpp 20 */ |