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]
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user