|
|
@ -217,7 +217,7 @@ The ``hello.h`` header file looks something like this::
|
|
|
|
TQ_OBJECT
|
|
|
|
TQ_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
Hello(QWidget *parent = 0);
|
|
|
|
Hello(TQWidget *parent = 0);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
// Prevent instances from being copied.
|
|
|
|
// Prevent instances from being copied.
|
|
|
@ -226,7 +226,7 @@ The ``hello.h`` header file looks something like this::
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(Q_OS_WIN)
|
|
|
|
#if !defined(Q_OS_WIN)
|
|
|
|
void setDefault(const QString &def);
|
|
|
|
void setDefault(const TQString &def);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
The corresponding SIP specification file would then look something like this::
|
|
|
|
The corresponding SIP specification file would then look something like this::
|
|
|
@ -246,14 +246,14 @@ The corresponding SIP specification file would then look something like this::
|
|
|
|
%End
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
Hello(QWidget *parent /TransferThis/ = 0);
|
|
|
|
Hello(TQWidget *parent /TransferThis/ = 0);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
Hello(const Hello &);
|
|
|
|
Hello(const Hello &);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
%If (!WS_WIN)
|
|
|
|
%If (!WS_WIN)
|
|
|
|
void setDefault(const QString &def);
|
|
|
|
void setDefault(const TQString &def);
|
|
|
|
%End
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
%End
|
|
|
|
%End
|
|
|
@ -283,7 +283,7 @@ previous examples.
|
|
|
|
argument. It specifies that if the argument is not 0 (i.e. the ``Hello``
|
|
|
|
argument. It specifies that if the argument is not 0 (i.e. the ``Hello``
|
|
|
|
instance being constructed has a parent) then ownership of the instance
|
|
|
|
instance being constructed has a parent) then ownership of the instance
|
|
|
|
is transferred from Python to C++. It is needed because TQt maintains
|
|
|
|
is transferred from Python to C++. It is needed because TQt maintains
|
|
|
|
objects (i.e. instances derived from the ``QObject`` class) in a
|
|
|
|
objects (i.e. instances derived from the ``TQObject`` class) in a
|
|
|
|
hierachy. When an object is destroyed all of its children are also
|
|
|
|
hierachy. When an object is destroyed all of its children are also
|
|
|
|
automatically destroyed. It is important, therefore, that the Python
|
|
|
|
automatically destroyed. It is important, therefore, that the Python
|
|
|
|
garbage collector doesn't also try and destroy them. This is covered in
|
|
|
|
garbage collector doesn't also try and destroy them. This is covered in
|
|
|
@ -515,9 +515,9 @@ As an example, PyQt4 uses :directive:`%DefaultMetatype` to specify a new
|
|
|
|
meta-type that handles the interaction with Qt's own meta-type system. It also
|
|
|
|
meta-type that handles the interaction with Qt's own meta-type system. It also
|
|
|
|
uses :directive:`%DefaultSupertype` to specify that the smaller
|
|
|
|
uses :directive:`%DefaultSupertype` to specify that the smaller
|
|
|
|
:class:`sip.simplewrapper` super-type is normally used. Finally it uses
|
|
|
|
:class:`sip.simplewrapper` super-type is normally used. Finally it uses
|
|
|
|
:canno:`Supertype` as an annotation of the ``QObject`` class to override the
|
|
|
|
:canno:`Supertype` as an annotation of the ``TQObject`` class to override the
|
|
|
|
default and use :class:`sip.wrapper` as the super-type so that the parent/child
|
|
|
|
default and use :class:`sip.wrapper` as the super-type so that the parent/child
|
|
|
|
relationships of ``QObject`` instances are properly maintained.
|
|
|
|
relationships of ``TQObject`` instances are properly maintained.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. _ref-lazy-type-attributes:
|
|
|
|
.. _ref-lazy-type-attributes:
|
|
|
|