From d09d800cbf1315fa91b8c04bce56930faaafe9dc Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 9 Apr 2011 18:10:52 +0000 Subject: [PATCH] 2011-04-09 11:08 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp ! Fixed: to supply strings per UTF8 conversion to Qt. Now it is equivalent to hbQT engine. --- harbour/ChangeLog | 5 +++++ .../contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8b8e488560..9921eb786c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-04-09 11:08 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp + ! Fixed: to supply strings per UTF8 conversion to Qt. + Now it is equivalent to hbQT engine. + 2011-04-09 13:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/3rd/png/pngwrite.c * src/3rd/png/pngconf.h diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp index 6ef80d64fb..9aea67bbd4 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp @@ -87,23 +87,29 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2 if( hb_itemType( ret ) & HB_IT_STRING ) { - vv = hb_itemGetCPtr( ret ); + void * pText01 = NULL; + vv = hb_itemGetStrUTF8( ret, &pText01, NULL ); + hb_strfree( pText01 ); HB_TRACE( HB_TR_DEBUG, ( " fetchData[ s = %s ]", hb_itemGetCPtr( ret ) ) ); + hb_itemRelease( ret ); } else if( hb_itemType( ret ) & HB_IT_LOGICAL ) { vv = hb_itemGetL( ret ); HB_TRACE( HB_TR_DEBUG, ( " fetchData[ l = %i ]", hb_itemGetL( ret ) ) ); + hb_itemRelease( ret ); } else if( hb_itemType( ret ) & HB_IT_DOUBLE ) { vv = hb_itemGetND( ret ); HB_TRACE( HB_TR_DEBUG, ( " fetchData[ d = %f ]", hb_itemGetND( ret ) ) ); + hb_itemRelease( ret ); } else if( hb_itemType( ret ) & HB_IT_NUMERIC ) { vv = hb_itemGetNI( ret ); HB_TRACE( HB_TR_DEBUG, ( " fetchData[ n = %i ]", hb_itemGetNI( ret ) ) ); + hb_itemRelease( ret ); } else if( hb_itemType( ret ) & HB_IT_OBJECT ) { @@ -125,6 +131,8 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2 vv = * ( ( QPixmap * ) ( p->ph ) ); else if( p->type == HBQT_TYPE_QFont ) vv = * ( ( QFont * ) ( p->ph ) ); + + hb_itemRelease( ret ); } hb_vmRequestRestore();