2012-06-03 03:02 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtcore/hbqt_bind.cpp
    + Implemented: requested by the group protocol - to handle 
      parent-child relations internally by hbQT leading not 
      to hold everything in scoped variables. All objects will 
      behave accordingly except QAction() which is never get a 
      parent accoring to Qt docs.

    ; NOTE: will explain this in detail in reply to the message 
            of this commit.
This commit is contained in:
Pritpal Bedi
2012-06-03 10:15:33 +00:00
parent 6cc95f05a2
commit bcf90cd673
2 changed files with 26 additions and 3 deletions

View File

@@ -16,6 +16,17 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-06-03 03:02 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/hbqt_bind.cpp
+ Implemented: requested by the group protocol - to handle
parent-child relations internally by hbQT leading not
to hold everything in scoped variables. All objects will
behave accordingly except QAction() which is never get a
parent accoring to Qt docs.
; NOTE: will explain this in detail in reply to the message
of this commit.
2012-06-03 01:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/hbmk2_qt.hb
! Changed: hb_itemReturn() => hb_itemReturnRelease() to honor

View File

@@ -398,10 +398,21 @@ void hbqt_bindDestroyHbObject( PHB_ITEM pObject )
* bind_ptr = bind->next;
if( bind->iFlags & HBQT_BIT_OWNER )
{
HB_TRACE( HB_TR_DEBUG, ( "hbqt_bindDestroyHbObject( %p )", bind->qtObject ) );
bind->pDelFunc( bind->qtObject, bind->iFlags );
if( bind->iFlags & HBQT_BIT_QOBJECT )
{
QObject * obj = ( QObject * ) bind->qtObject;
if( obj && obj->parent() == NULL )
{
HB_TRACE( HB_TR_ALWAYS, ( "hbqt_bindDestroyHbObject( %p )", bind->qtObject ) );
bind->pDelFunc( bind->qtObject, bind->iFlags );
}
}
else
{
bind->pDelFunc( bind->qtObject, bind->iFlags );
}
}
hb_xfree( bind );
hb_xfree( bind ); /* By all means we need to clean Harbour ocuupied memory */
break;
}
bind_ptr = &bind->next;
@@ -420,6 +431,7 @@ void hbqt_bindDestroyQtObject( void * qtObject )
{
if( bind->qtObject == qtObject )
{
HB_TRACE( HB_TR_ALWAYS, ( "hbqt_bindDestroyQtObject( %p )", bind->qtObject ) );
* bind_ptr = bind->next;
hb_xfree( bind );
break;