type qx extends QObject
   declare operator cast as any ptr
   declare constructor
   declare destructor
end type

namespace x
    function Register as zstring ptr
        return @"UserTypes=Qx"
    end function
end namespace

operator qx.cast as any ptr
   return @this
end operator

constructor qx
   'your code here
end constructor

destructor qx
   'your code here
end destructor

sub x_initialization constructor
    'Qx.register
end sub