diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9fa5bb2db3..6d09524b9c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-28 23:21 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp + * contrib/hbqt/qtcore/hbqt_init.cpp + * Final cleanups to de-raw-pointerization [Francesco Perillo] + 2011-02-28 21:42 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbpp.h * harbour/include/hbapilng.h diff --git a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp index 33e9bc9aa7..217a8a4248 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp @@ -104,7 +104,7 @@ static void hbqt_SlotsExecPointer( PHB_ITEM * codeBlock, void ** arguments, QStr hb_vmPushEvalSym(); hb_vmPush( codeBlock ); - hb_vmPush( hbqt_create_objectGC( hbqt_gcAllocate_QObject( ( *reinterpret_cast< void*( * ) >( arguments[ 1 ] ) ), false ), ( const char * ) pList.at( 0 ).toAscii().data() ) ); + hb_vmPush( hbqt_create_objectGC( hbqt_gcAllocate_QObject( ( *reinterpret_cast< void*( * ) >( arguments[ 1 ] ) ), false ), ( const char * ) pList.at( 0 ).data() ) ); hb_vmSend( 1 ); } @@ -125,7 +125,7 @@ static void hbqt_SlotsExecPointerInt( PHB_ITEM * codeBlock, void ** arguments, Q hb_vmPushEvalSym(); hb_vmPush( codeBlock ); - hb_vmPush( hbqt_create_objectGC( hbqt_gcAllocate_QObject( ( *reinterpret_cast< void*( * ) >( arguments[ 1 ] ) ), false ), ( const char * ) pList.at( 0 ).toAscii().data() ) ); + hb_vmPush( hbqt_create_objectGC( hbqt_gcAllocate_QObject( ( *reinterpret_cast< void*( * ) >( arguments[ 1 ] ) ), false ), ( const char * ) pList.at( 0 ).data() ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ); hb_vmSend( 2 ); } diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp index 0cbf41dd94..8e5fa7a55a 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp @@ -739,21 +739,26 @@ void HBQGraphicsItem::prepare( QPainter * painter ) { case HBQT_GRAPHICSITEM_SIMPLETEXT : { - if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_NONE ){ + if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_NONE ) + { return; } QRectF rect = boundingRect(); adjustRect( rect ); QFontMetricsF fm( painter->font() ); - if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_AUTO ){ + if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_AUTO ) + { qreal wd = fm.width( QString_text ); - if( wd > width() ){ + if( wd > width() ) + { setWidth( wd ); } } - else { + else + { QRectF rc = fm.boundingRect( rect, textFlags(), QString_text ); - if( rc.height() > rect.height() ){ + if( rc.height() > rect.height() ) + { //setStretch( rc.height() - rect.height() ); } } @@ -765,11 +770,12 @@ void HBQGraphicsItem::prepare( QPainter * painter ) void HBQGraphicsItem::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * /* widget */ ) { - if( block ){ + if( block ) + { QRectF rect = ( option->type == QStyleOption::SO_GraphicsItem ) ? boundingRect() : option->exposedRect; PHB_ITEM p1 = hb_itemPutNI( NULL, 21017 ); - PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QPainter( painter, false ), "QPainter*" ); + PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QPainter( painter, false ), "hb_QPainter" ); PHB_ITEM p3 = hb_itemPutPtr( NULL, &rect ); hb_vmEvalBlockV( block, 3, p1, p2, p3 ); hb_itemRelease( p1 );