2012-04-20 21:22 UTC+0200 Viktor Szakats (harbour syenar.net)

* include/harbour.hbx
    * set formatting for new functions

  * ChangeLog
    ! deleted unicode BOM. Please set your editor to not readd it.

  * contrib/hbqt/gtqtc/gtqtc.cpp
    ! quick fix for build failure.

  * contrib/hbqt/hbmk2_qt.hbs
  * contrib/hbqt/qtcore/hbqt_pointer.cpp
  * contrib/hbqt/qtcore/hbqt.h
    * object type checking patch from Teo and Francesco. Please test.
      (with minor changes)
    + added TOFIX for missing CP conversion in certain cases.

  * contrib/hbqt/qtcore/hbqt_misc.prg
    * implemented destroy patch from Francesco. Please test.
This commit is contained in:
Viktor Szakats
2012-04-20 19:24:18 +00:00
parent 93d3a46d84
commit 2a5fb3036c
7 changed files with 63 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* $Id$
*/
@@ -16,6 +16,26 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-04-20 21:22 UTC+0200 Viktor Szakats (harbour syenar.net)
* include/harbour.hbx
* set formatting for new functions
* ChangeLog
! deleted unicode BOM. Please set your editor to not readd it.
* contrib/hbqt/gtqtc/gtqtc.cpp
! quick fix for build failure.
* contrib/hbqt/hbmk2_qt.hbs
* contrib/hbqt/qtcore/hbqt_pointer.cpp
* contrib/hbqt/qtcore/hbqt.h
* object type checking patch from Teo and Francesco. Please test.
(with minor changes)
+ added TOFIX for missing CP conversion in certain cases.
* contrib/hbqt/qtcore/hbqt_misc.prg
* implemented destroy patch from Francesco. Please test.
2012-04-20 17:52 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/include/hbdefs.h
* moved HB_WCHAR definition from hbapicdp.h to hbdefs.h

View File

@@ -1161,8 +1161,8 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
pFuncTable->Version = hb_gt_wvt_Version;
pFuncTable->Tone = hb_gt_wvt_Tone;
pFuncTable->Info = hb_gt_wvt_Info;
pFuncTable->SetDispCP = hb_gt_wvt_SetDispCP;
pFuncTable->SetKeyCP = hb_gt_wvt_SetKeyCP;
// pFuncTable->SetDispCP = hb_gt_wvt_SetDispCP;
// pFuncTable->SetKeyCP = hb_gt_wvt_SetKeyCP;
pFuncTable->ReadKey = hb_gt_wvt_ReadKey;
pFuncTable->MouseIsPresent = hb_gt_wvt_mouse_IsPresent;
@@ -1458,8 +1458,6 @@ void DrawingArea::setCaretPos( int iCol, int iRow )
}
void DrawingArea::displayCell( int iRow, int iCol )
{
PHB_GTWVT pWVT = HB_GTWVT_GET( pGT );
QPainter painter( _image );
painter.setBackgroundMode( Qt::OpaqueMode );
QFont font( _qFont, painter.device() );

View File

@@ -2320,9 +2320,9 @@ STATIC FUNCTION hbqtgen_paramCheckStrCpp( cType, nArg, cCast )
CASE "P" //TODO
RETURN "HB_ISPOINTER( " + hb_ntos( nArg ) + " )"
CASE "O"
RETURN "HB_ISOBJECT( " + hb_ntos( nArg ) + " )"
RETURN "hbqt_par_isDerivedFrom( " + hb_ntos( nArg ) + ", " + '"HB_' + cCast + '"' + " )"
CASE "CO"
RETURN "( HB_ISOBJECT( " + hb_ntos( nArg ) + " ) || HB_ISCHAR( " + hb_ntos( nArg ) + " ) )"
RETURN "( hbqt_par_isDerivedFrom( " + hb_ntos( nArg ) + ", " + '"HB_' + cCast +'"' + " ) || HB_ISCHAR( " + hb_ntos( nArg ) + " ) )"
CASE "N*"
RETURN "HB_ISBYREF( " + hb_ntos( nArg ) + " )"
CASE "N"

View File

@@ -103,6 +103,8 @@ extern HB_EXPORT void hbqt_par_detach_ptrGC( int iParam );
extern HB_EXPORT void hbqt_itemPushReturn( void * ptr, PHB_ITEM pSelf );
extern HB_EXPORT HB_U32 hbqt_getObjectType( int iParam );
extern HB_EXPORT HB_BOOL hbqt_isObjectType( int iParam, HB_U32 iType ); /* check if parameter iParam is EXACTLY of type iType */
extern HB_EXPORT HB_BOOL hbqt_par_isDerivedFrom( int iParam, const char * szClsName ); /* check if parameter iParam is class or subclass of szClsName */
extern HB_EXPORT HB_BOOL hbqt_obj_isDerivedFrom( PHB_ITEM pItem, const char * szClsName ); /* check if parameter iParam is class or subclass of szClsName */
extern HB_EXPORT void * hbqt_get_ptr( PHB_ITEM pObj );
extern HB_EXPORT const HB_GC_FUNCS * hbqt_gcFuncs( void );
@@ -115,7 +117,7 @@ extern HB_EXPORT void hbqt_addDeleteList( PHB_ITEM item ); /* populate a list of
HB_EXTERN_END
#define hbqt_par_QString( n ) ( ( QString ) hb_parcx( n ) )
#define hbqt_par_QString( n ) ( ( QString ) hb_parcx( n ) ) /* TOFIX: use Str API */
#define hbqt_par_uchar( n ) ( ( uchar * ) hb_parcx( n ) )
#define hbqt_par_QRgb( n ) ( hb_parnint( n ) )
#define hbqt_par_Bool( n ) ( hb_parl( n ) )

View File

@@ -212,6 +212,10 @@ METHOD HbQtObjectHandler:disconnect( cnEvent )
METHOD HbQtObjectHandler:_destroy()
IF __objDerivedFrom( Self, "HB_OBJECT" )
::disconnect()
ENDIF
::__pSlots := NIL
::__pEvents := NIL

View File

@@ -478,6 +478,25 @@ PHB_ITEM hbqt_create_objectGC( void * pObject, const char * pszObjectName )
return hb_stackReturnItem();
}
HB_BOOL hbqt_obj_isDerivedFrom( PHB_ITEM pItem, const char * szClsName )
{
return hb_clsIsParent( hb_objGetClass( pItem ), szClsName );
}
/* Checks that the param iParam is an object and a subclass of szClsName */
HB_BOOL hbqt_par_isDerivedFrom( int iParam, const char * szClsName )
{
PHB_ITEM pItem;
HB_TRACE( HB_TR_DEBUG, ( "hbqt_par_isDerivedFrom( %i, %s )", iParam, szClsName ) );
if( ( pItem = hb_param( iParam, HB_IT_OBJECT ) ) != NULL )
return hbqt_obj_isDerivedFrom( pItem, szClsName );
return HB_FALSE;
}
/*----------------------------------------------------------------------*/
#endif

View File

@@ -310,8 +310,8 @@ DYNAMIC hb_ATokens
DYNAMIC hb_AtX
DYNAMIC hb_base64Decode
DYNAMIC hb_base64Encode
DYNAMIC HB_BCHAR
DYNAMIC HB_BCODE
DYNAMIC hb_BChar
DYNAMIC hb_BCode
DYNAMIC hb_bitAnd
DYNAMIC hb_bitNot
DYNAMIC hb_bitOr
@@ -320,12 +320,12 @@ DYNAMIC hb_bitSet
DYNAMIC hb_bitShift
DYNAMIC hb_bitTest
DYNAMIC hb_bitXor
DYNAMIC HB_BLEN
DYNAMIC hb_BLen
DYNAMIC hb_blowfishDecrypt
DYNAMIC hb_blowfishEncrypt
DYNAMIC hb_blowfishKey
DYNAMIC HB_BPEEK
DYNAMIC HB_BPOKE
DYNAMIC hb_BPeek
DYNAMIC hb_BPoke
DYNAMIC hb_BuildDate
DYNAMIC hb_ByteSwapI
DYNAMIC hb_ByteSwapL
@@ -620,13 +620,13 @@ DYNAMIC hb_isSymbol
DYNAMIC hb_isTimeStamp
DYNAMIC hb_jsonDecode
DYNAMIC hb_jsonEncode
DYNAMIC HB_KEYCHAR
DYNAMIC hb_KeyChar
DYNAMIC hb_KeyClear
DYNAMIC hb_KeyIns
DYNAMIC hb_KeyLast
DYNAMIC hb_KeyNext
DYNAMIC hb_KeyPut
DYNAMIC HB_KEYSTD
DYNAMIC hb_KeyStd
DYNAMIC hb_langErrMsg
DYNAMIC hb_langMessage
DYNAMIC hb_langName
@@ -826,11 +826,11 @@ DYNAMIC hb_TToC
DYNAMIC hb_TToD
DYNAMIC hb_TToN
DYNAMIC hb_TToS
DYNAMIC HB_UCHAR
DYNAMIC HB_UCODE
DYNAMIC HB_ULEN
DYNAMIC HB_UPEEK
DYNAMIC HB_UPOKE
DYNAMIC hb_UChar
DYNAMIC hb_UCode
DYNAMIC hb_ULen
DYNAMIC hb_UPeek
DYNAMIC hb_UPoke
DYNAMIC hb_UserLang
DYNAMIC hb_UserName
DYNAMIC hb_UTCOffset