I have yet another proposal:
in QGC_POINTER_* a new member should be added, call it "fingerprint".
Every QObject should be issued a different "fingerprint", let's say
QApplication is 1, QPushButton is 2 and so on.
So when we get somehow a QGC_POINTER_* we can get back it's c++ class...
hbqt_gcpointer may accept as second parameter the fingerprint of the
requested object and RTE if not matched.... it may be 0 to not do any
check...
typedef struct
{
void * ph;
bool bNew;
QT_G_FUNC_PTR func;
QPointer< QPushButton > pq;
long fingerprint;
} QGC_POINTER_QPushButton;
p->bNew = bNew;
p->func = hbqt_gcRelease_QPushButton;
p->fingerprint = 2 ;
...
#define hbqt_par_QPushButton( n ) ( ( QPushButton
* ) hbqt_gcpointer( n ) )
becomes
#define hbqt_par_QPushButton( n ) ( ( QPushButton
* ) hbqt_gcpointer( n , 2 ) )
and hbqt_gcpinter is amended as necessary.
It must be said that hbqt_gcpointer is allways called via the previous
defines. Only in hbqt_destruct.cpp is called directly twice with -1
and a couple of times with iParam...
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour