diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a4ccef6c98..dbdc5a13cc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-15 10:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/utils/hbqtgen.prg + + Changed HB_ class instantiation function STATIC. + + Added FromPointer() function to create class from a raw class pointer. + (this should be eliminated ASAP) + + Added From() function to create class from another class. + It's now simply calling :from() in base class, which is wrong + and should be fixed for two reasons: + - raw pointer is allowed (all such calls should be changed to FromPointer()) + - no object type checking is made. + + ; NOTE: Please update HBIDE and HBXBP to use these rules: + HB_:from( ptr ) => FromPointer( ptr ) + HB_:from( obj ) => From( obj ) + 2010-10-15 09:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtcore/hbqt_pointer.cpp * contrib/hbqt/qtcore/hbqtcore.hbx diff --git a/harbour/contrib/hbqt/utils/hbqtgen.prg b/harbour/contrib/hbqt/utils/hbqtgen.prg index 2ae246cdc3..91c2f9a27a 100644 --- a/harbour/contrib/hbqt/utils/hbqtgen.prg +++ b/harbour/contrib/hbqt/utils/hbqtgen.prg @@ -1056,10 +1056,16 @@ METHOD HbQtSource:buildClass() aadd( txt_, "FUNCTION " + ::cWidget + "( ... )" ) aadd( txt_, " RETURN HB_" + ::cWidget + "():new( ... )" ) aadd( txt_, "" ) + aadd( txt_, "FUNCTION " + ::cWidget + "From( ... )" ) + aadd( txt_, " RETURN HB_" + ::cWidget + "():from( ... )" ) + aadd( txt_, "" ) + aadd( txt_, "FUNCTION " + ::cWidget + "FromPointer( ... )" ) + aadd( txt_, " RETURN HB_" + ::cWidget + "():fromPointer( ... )" ) + aadd( txt_, "" ) aadd( txt_, "" ) n := ascan( ::cls_, {|e_| left( lower( e_[ 1 ] ), 7 ) == "inherit" .and. !empty( e_[ 2 ] ) } ) - s := "CREATE CLASS " + ::cWidget + " INHERIT HbQtObjectHandler" + iif( n > 0, ", " + strtran( ::cls_[ n, 2 ], "Q", "HB_Q" ), "" ) + " FUNCTION HB_" + ::cWidget + s := "CREATE CLASS " + ::cWidget + " INHERIT HbQtObjectHandler" + iif( n > 0, ", " + strtran( ::cls_[ n, 2 ], "Q", "HB_Q" ), "" ) + " STATIC FUNCTION HB_" + ::cWidget aadd( txt_, s ) aadd( txt_, " " )