QAxAggregated(3qt)
QAxAggregated π β¨
okay so bestie, we're in the qaxaggregated section of the manual (the 3qt one, iykyk), and this is the Qt ActiveQt Extension era. buckle up π
β¨ NAME β¨
QAxAggregated β the abstract base class for implementations of additional COM interfaces. she's abstract, she's a base, she's the blueprint π¦
πΈ SYNOPSIS πΈ
no cap, this class is part of the Qt ActiveQt Extension.
#include <qaxbindable.h>
π Public Members π
virtual long queryInterface ( const QUuid & iid, void ** iface ) = 0β the one you have to implement, fr fr
π Protected Members π
IUnknown * controllingUnknown () constQWidget * widget () constQObject * object () const
π DESCRIPTION π
okay so first thing's first: this class lives in the Qt ActiveQt Extension, which you'll find in the qt/extensions directory. it is not included in the main Qt API. like, she's in the extensions wing of the building, not the main lobby π
QAxAggregated is an abstract base class for implementations of additional COM interfaces.
here's the vibe: you create a subclass of QAxAggregated and reimplement queryInterface() to support additional COM interfaces. then you use multiple inheritance from those COM interfaces. and for the IUnknown interface of those COM interfaces β you implement it by delegating the calls to QueryInterface(), AddRef() and Release() over to the interface that controllingUnknown() hands you. slay π«Ά
and if you need to make calls to the QWidget implementing the ActiveX control, use the widget() method. but listen β you must not store that pointer in your subclass (unless you use QGuardedPtr), because the QWidget can be destroyed by the ActiveQt framework at any time. she's ephemeral bestie, she's a fleeting vibe, do not get attached π
π¦ MEMBER FUNCTION DOCUMENTATION π¦
IUnknown * QAxAggregated::controllingUnknown () const [protected]
returns the IUnknown interface of the ActiveX control. so the move here is: implement the IUnknown interface in your QAxAggregated subclass to delegate calls to QueryInterface(), AddRef() and Release() to the interface provided by this function. like so β¨
HRESULT AxImpl::QueryInterface( REFIID iid, void **iface )
{
return controllingUnknown()->QueryInterface( iid, iface );
}
unsigned long AxImpl::AddRef()
{
return controllingUnknown()->AddRef();
}
unsigned long AxImpl::Release()
{
return controllingUnknown()->Release();
}
and the way that the QAXAGG_IUNKNOWN macro just expands to exactly that code above?? iconic. use it in the class declaration of your subclass and you're done π
QObject * QAxAggregated::object () const [protected]
returns a pointer to the QObject subclass implementing the COM object. heads up though: this function might return 0 π
Warning: you must not store the returned pointer, unless you use aQGuardedPtr, since theQObjectcan be destroyed by ActiveQt at any time.
long QAxAggregated::queryInterface ( const QUuid & iid, void ** iface ) [pure virtual]
reimplement this pure virtual function to support additional COM interfaces. set the value of iface to point to this object to support the interface iid. and note that you must cast the this pointer to the appropriate superclass β no shortcuts, no skipping that step π
long AxImpl::queryInterface( const QUuid &iid, void **iface )
{
*iface = 0;
if ( iid == IID_ISomeCOMInterface )
*iface = (ISomeCOMInterface*)this;
else
return E_NOINTERFACE;
AddRef();
return S_OK;
}
return the standard COM results S_OK (interface is supported) or E_NOINTERFACE (requested interface is not supported). that's it, that's the whole assignment π
Warning: even though you must implement theIUnknowninterface if you implement any COM interface, you must not support theIUnknowninterface in yourqueryInterface()implementation. yes this is confusing. no you may not argue. periodt.
QWidget * QAxAggregated::widget () const [protected]
returns a pointer to the QWidget subclass implementing the ActiveX control. this function might return 0 too, so like, vibe check before you deref π§
Warning: you must not store the returned pointer, unless you use aQGuardedPtr, since theQWidgetcan be destroyed by ActiveQt at any time.
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
β AUTHOR β
Generated automatically from the source code. (so if she's got attitude, blame the source, not a person π)
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. Thank you π«Ά (genuinely, thank you, the maintainers are doing their best)
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. not me reading the unofficial version π
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qaxaggregated.3qt) and the Qt version (3.3.8). include both or the report is giving nothing, fr fr π₯
and that's the whole page bestie, no cap, every last flag and footnote accounted for π
Trolltech AS Β· 2 February 2007 Β· Qt 3.3.8 β mwah, take care of her, she's a legacy icon πβ¨π¦
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms