Hello Viktor
Viktor Szakáts wrote: > > Can we somehow solve it to not require the use > of QT_PTROF() when passing HBQT object references > to other HBQT objects? > > IMO this macro makes .prg programming more cryptic > than necessary, and the whole code looks a little > bit unusual and difficult to type. > > Is it possible that low level code check for > object type, class and extract this :pPtr > member automatically? > > so instead of this: > --- > oDA := QWidget():new( QT_PTROF( oWnd ) ) > oWnd:setCentralWidget( QT_PTROF( oDA ) ) > > oSBar := QStatusBar():new( QT_PTROF( oWnd ) ) > oWnd:setStatusBar( QT_PTROF( oSBar ) ) > oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) > --- > > one could write this: > --- > oDA := QWidget():new( oWnd ) > oWnd:setCentralWidget( oDA ) > > oSBar := QStatusBar():new( oWnd ) > oWnd:setStatusBar( oSBar ) > oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) > --- > This is the natural way if I could have achieved it this way. Actually I started it like this, also Marcos extended this idea, but because of the classes generated auto, this was not possible. Let me explain it why: We create a new object and it is a Harbour object. Qt's wrappers accept only pointers. Qt's wrapper functions are combination of pointer as well as other types of parameters. At the level of auto generation of code, it is not analyzed which is a pointer, and which is a non pointer. If it is analyzed at the time of generation, then class methods have to be adjusted to entertain this phenomena. Class method will have to analyse every parameters if it is a pointer or otherwise. Actually I could not find a way to achieve it, though I tried a lot. Anyhow, at present I have an idea how to achieve it, I will give it another thought. Regards Pritpal Bedi -- View this message in context: http://old.nabble.com/QT_PTROF%28%29-tp26824045p26824379.html Sent from the Harbour - Dev mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour