<p>Our widget will be derived from <ahref="ntqwidget.html">TQWidget</a> so we include the <tt>ntqwidget.h</tt> header file. We also forward declare the two classes that our widget will be built from.</p>
<pre></pre>
<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><!-- index Macros!Q_ENUMS --><!-- index Q_ENUMS --><p>We include the <tt>TQ_OBJECT</tt> macro since this is required for classes that declare signals or slots. The <tt>Q_ENUMS</tt> declaration is used to register the Mode enumeration. Our widget has two properties, mode, to store whether the user should select a File or a Directory and fileName which stores the file or directory they chose.</p>
<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><!-- index Macros!TQ_ENUMS --><!-- index TQ_ENUMS --><p>We include the <tt>TQ_OBJECT</tt> macro since this is required for classes that declare signals or slots. The <tt>TQ_ENUMS</tt> declaration is used to register the Mode enumeration. Our widget has two properties, mode, to store whether the user should select a File or a Directory and fileName which stores the file or directory they chose.</p>
<pre> class QT_WIDGET_PLUGIN_EXPORT FileChooser : public <ahref="ntqwidget.html">TQWidget</a>
@ -40,9 +40,9 @@ features like <tt>__property</tt> or <tt>[property]</tt>. Our solution works wit
<em>any</em> standard C++ compiler on every platform we support. It's based
on the meta-object system that also provides object communication
through <ahref="signalsandslots.html">signals and slots</a>.
<p> The <tt>Q_PROPERTY</tt> macro in a class declaration declares a
property. Properties can only be declared in classes that inherit <ahref="ntqobject.html">TQObject</a>. A second macro, <tt>Q_OVERRIDE</tt>, can be used to override some
aspects of an inherited property in a subclass. (See <ahref="#override">Q_OVERRIDE</a>.)
<p> The <tt>TQ_PROPERTY</tt> macro in a class declaration declares a
property. Properties can only be declared in classes that inherit <ahref="ntqobject.html">TQObject</a>. A second macro, <tt>TQ_OVERRIDE</tt>, can be used to override some
aspects of an inherited property in a subclass. (See <ahref="#override">TQ_OVERRIDE</a>.)
<p> To the outer world, a property appears to be similar to a data member.
But properties have several features that distinguish them from
ordinary data members:
@ -100,9 +100,9 @@ functions in use:
</pre>
<p> The class has a property "priority" that is not yet known to the <ahref="metaobjects.html#meta-object">meta object</a> system. In order to make the property known, you must
declare it with the <tt>Q_PROPERTY</tt> macro. The syntax is as follows:
declare it with the <tt>TQ_PROPERTY</tt> macro. The syntax is as follows:
<p><pre>
Q_PROPERTY( type name READ getFunction [WRITE setFunction]
TQ_PROPERTY( type name READ getFunction [WRITE setFunction]
[RESET resetFunction] [DESIGNABLE bool]
[SCRIPTABLE bool] [STORED bool] )
</pre>
@ -127,14 +127,14 @@ these cases the type must be specified as <a href="ntqvaluelist.html">TQValueLis
In the case of <ahref="ntqvaluelist.html">TQValueList</a> and <ahref="ntqmap.html">TQMap</a> properties the value passes
is a <ahref="ntqvariant.html">TQVariant</a> whose value is the entire list or map.
<p> Enumeration types are registered with the <tt>Q_ENUMS</tt> macro. Here's the
<p> Enumeration types are registered with the <tt>TQ_ENUMS</tt> macro. Here's the
final class declaration including the property related declarations:
<p><pre>
class MyClass : public <ahref="ntqobject.html">TQObject</a>
The ActiveX controls in this example are simple <ahref="ntqwidget.html">TQWidget</a>
subclasses reimplementing the paintEvent() method. The classes use
the Q_CLASSINFO macro to
<p> The example demonstrates the use of the Q_CLASSINFO macro to set
the TQ_CLASSINFO macro to
<p> The example demonstrates the use of the TQ_CLASSINFO macro to set
<ahref="activentqt.html#ActiveTQt">ActiveTQt</a>-specific attributes for <ahref="ntqobject.html">TQObject</a> sub classes, and the use of
the <ahref="qaxfactory.html#TQAXFACTORY_BEGIN">TQAXFACTORY_BEGIN</a>, <ahref="qaxfactory.html#TQAXCLASS">TQAXCLASS</a> and <ahref="qaxfactory.html#TQAXFACTORY_END">TQAXFACTORY_END</a> macros.
<p>
@ -44,12 +44,12 @@ the <a href="qaxfactory.html#TQAXFACTORY_BEGIN">TQAXFACTORY_BEGIN</a>, <a href="
<pre> class TQAxWidget1 : public <ahref="ntqwidget.html">TQWidget</a>
</pre>The class declaration includes the TQ_OBJECT macro to activate TQt's <ahref="metaobjects.html#meta-object">meta object</a> system, and sets COM identifiers for the class using the
@ -388,9 +388,9 @@ or any existing TQWidget subclass:
<p> The <ahref="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> macro is required to provide the <ahref="metaobjects.html#meta-object">meta object</a> information
about the widget to the ActiveTQt framework.
Use the <tt>Q_PROPERTY</tt> macro to declare properties for the ActiveX control:
Use the <tt>TQ_PROPERTY</tt> macro to declare properties for the ActiveX control:
<p><pre>
Q_PROPERTY( int value READ value WRITE setValue )
TQ_PROPERTY( int value READ value WRITE setValue )
</pre>
<p> Declare a standard TQWidget constructor taking a parent widget and a name,
@ -228,7 +228,7 @@ If you implement your own factory reimplement the pure virtual functions, provid
.br
.fi
.PP
If you use the \fCQ_CLASSINFO\fR macro to provide the unique identifiers or other attributes for your class you can use the QAXFACTORY_BEGIN, QAXCLASS and QAXFACTORY_END macros to expose one or more classes as COM objects.
If you use the \fCTQ_CLASSINFO\fR macro to provide the unique identifiers or other attributes for your class you can use the QAXFACTORY_BEGIN, QAXCLASS and QAXFACTORY_END macros to expose one or more classes as COM objects.
.PP
.nf
.br
@ -268,7 +268,7 @@ Reimplement this function to return the ActiveX server's application identifier.
Reimplement this function to return the class identifier for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR.
.PP
The default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "ClassID".
The default implementation interprets \fIkey\fR as the class name, and returns the value of the TQ_CLASSINFO entry "ClassID".
Reimplement this function to return a new widget for \fIkey\fR. Propagate \fIparent\fR and \fIname\fR to the QWidget constructor. Return 0 if this factory doesn't support the value of \fIkey\fR.
.PP
@ -288,11 +288,11 @@ The default implementation creates a generic automation wrapper based on the met
Reimplement this function to return the identifier of the event interface for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR.
.PP
The default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "EventsID".
The default implementation interprets \fIkey\fR as the class name, and returns the value of the TQ_CLASSINFO entry "EventsID".
Reimplement this function to return the name of the super class of \fIkey\fR up to which methods and properties should be exposed by the ActiveX control.
.PP
The default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "ToSuperClass". If no such value is set the null-string is returned, and the functions and properties of all the super classes including QWidget will be exposed.
The default implementation interprets \fIkey\fR as the class name, and returns the value of the TQ_CLASSINFO entry "ToSuperClass". If no such value is set the null-string is returned, and the functions and properties of all the super classes including QWidget will be exposed.
.PP
To only expose the functions and properties of the class itself, reimplement this function to return \fIkey\fR.
The default implementation interprets \fIkey\fR as the class name, and returns TRUE if the value of the Q_CLASSINFO entry "StockEvents" is "yes". Otherwise this function returns FALSE.
The default implementation interprets \fIkey\fR as the class name, and returns TRUE if the value of the TQ_CLASSINFO entry "StockEvents" is "yes". Otherwise this function returns FALSE.
Reimplement this function to return the interface identifier for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR.
.PP
The default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "InterfaceID".
The default implementation interprets \fIkey\fR as the class name, and returns the value of the TQ_CLASSINFO entry "InterfaceID".
.SH "bool QAxFactory::isServer ()\fC [static]\fR"
Returns TRUE if the application has been started (by COM) as an ActiveX server, otherwise returns FALSE.
.PP
@ -405,7 +405,7 @@ See also registerClass() and QSettings.
Reimplement this function to return TRUE if \fIlicenseKey\fR is a valid license for the class \fIkey\fR, or if the current machine is licensed.
.PP
The default implementation returns TRUE if the class \fIkey\fR is not
licensed (ie. no Q_CLASSINFO attribute "LicenseKey"), or if
licensed (ie. no TQ_CLASSINFO attribute "LicenseKey"), or if
\fIlicenseKey\fR matches the value of the "LicenseKey" attribute, or
if the machine is licensed through a .LIC file with the same filename
Insert a new classname/property pair, which is used for custom SQL field editors. There \fImust\fR be a \fCQ_PROPERTY\fR clause in the \fIclassname\fR class declaration for the \fIproperty\fR.
Insert a new classname/property pair, which is used for custom SQL field editors. There \fImust\fR be a \fCTQ_PROPERTY\fR clause in the \fIclassname\fR class declaration for the \fIproperty\fR.