From 17385d0aba13b9b1f1421d2b599f7eb22bd59bca Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 21 Jun 2012 02:59:49 +0000 Subject: [PATCH] 2012-06-20 19:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqt_bind.cpp ! Organized: tracelog entries. * contrib/hbqt/qtgui/THbQtUI.prg - Deleted: DESTRUCTOR _destroy(). --- harbour/ChangeLog | 7 +++++++ harbour/contrib/hbqt/qtcore/hbqt_bind.cpp | 8 +++----- harbour/contrib/hbqt/qtgui/THbQtUI.prg | 13 +++++-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b3a70244d7..dcd88e4fce 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-20 19:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtcore/hbqt_bind.cpp + ! Organized: tracelog entries. + + * contrib/hbqt/qtgui/THbQtUI.prg + - Deleted: DESTRUCTOR _destroy(). + 2012-06-20 18:44 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/qth/QDataStream.qth * contrib/hbqt/qtcore/qth/QEventLoop.qth diff --git a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp index 9c4bc1d343..23bc88d999 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp @@ -425,20 +425,17 @@ void hbqt_bindDestroyHbObject( PHB_ITEM pObject ) { if( bind->pDelFunc != NULL ) { - HB_TRACE( HB_TR_DEBUG, ( ".........HARBOUR_DESTROYING_ACTUAL_QT_OBJECT( %p, %s, %i )", bind->qtObject, bind->szClassName, bind->iFlags ) ); if( bind->iFlags & HBQT_BIT_QOBJECT ) { - HB_TRACE( HB_TR_DEBUG, ( ".........HARBOUR_DESTROYING_ACTUAL_QT_OBJECT_NAMED( %p, %s )", bind->qtObject, ( ( QObject * ) bind->qtObject )->objectName().toAscii().data() ) ); if( bind->iThreadId == 1 && ( ( QObject * ) bind->qtObject )->objectName() == "PleaseDoNotDelete" ) /* This is a hack: will be removed a bit later */ { + HB_TRACE( HB_TR_DEBUG, ( ".........HARBOUR_NOT_DESTROYING_ACTUAL_QT_OBJECT( %p, %s, PleaseDoNotDelete )", bind->qtObject, bind->szClassName ) ); fDelQtObject = false; } -// else if( ( QString ) ( ( QObject * ) bind->qtObject )->metaObject()->className() == "QDesktopWidget" ) -// fDelQtObject = false; } if( fDelQtObject ) { - HB_TRACE( HB_TR_DEBUG, ( ".........HARBOUR_DESTROYING_ACTUAL_QT_OBJECT_NAMED( %p, %s )", bind->qtObject, bind->szClassName ) ); + HB_TRACE( HB_TR_DEBUG, ( ".........HARBOUR_DESTROYING_ACTUAL_QT_OBJECT( %p, %s )", bind->qtObject, bind->szClassName ) ); bind->fDeleting = true; bind->pDelFunc( bind->qtObject, bind->iFlags ); bind->fDeleting = false; @@ -482,6 +479,7 @@ void hbqt_bindDestroyQtObject( void * qtObject ) hb_vmRequestRestore(); } + HB_TRACE( HB_TR_DEBUG, ( "............QT_DESTROY_ENDS( %p )..............", qtObject ) ); } HBQSlots * hbqt_bindGetReceiverSlotsByHbObject( PHB_ITEM pObject ) diff --git a/harbour/contrib/hbqt/qtgui/THbQtUI.prg b/harbour/contrib/hbqt/qtgui/THbQtUI.prg index f9e8191c12..3abe1f7dbc 100644 --- a/harbour/contrib/hbqt/qtgui/THbQtUI.prg +++ b/harbour/contrib/hbqt/qtgui/THbQtUI.prg @@ -69,16 +69,17 @@ #include "error.ch" #include "hbtrace.ch" +#define Qt_WA_DeleteOnClose 55 + /*----------------------------------------------------------------------*/ -CREATE CLASS HbQtUI INHERIT HbQtObjectHandler +CREATE CLASS HbQtUI VAR oWidget /* TOFIX: User code uses this directly. Then rename this to __oRootWidget and make it PROTECTED. */ VAR qObj INIT { => } /* TOFIX: User code uses this directly. Then rename this to __hWidget and make it PROTECTED. */ METHOD new( oRootWidget, hWidget ) METHOD destroy() - DESTRUCTOR _destroy() ERROR HANDLER __OnError( ... ) @@ -91,16 +92,12 @@ METHOD HbQtUI:new( oRootWidget, hWidget ) ::oWidget := oRootWidget ::qObj := hWidget + ::oWidget:setAttribute( Qt_WA_DeleteOnClose, .f. ) + RETURN Self /*----------------------------------------------------------------------*/ -/* QUESTION: Is this needed? */ -METHOD HbQtUI:_destroy() - RETURN ::destroy() - -/*----------------------------------------------------------------------*/ - METHOD HbQtUI:destroy() LOCAL oObj