From dd2a2956df6716982a4d0723fa338c841499c9f7 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 28 Jun 2012 18:58:58 +0000 Subject: [PATCH] 2012-06-28 11:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbpfiledialog.prg ! Fixed: a regression where QApplication():focusWidget() was returned as a NIL instead of QWidget. --- harbour/ChangeLog | 5 +++++ harbour/contrib/hbxbp/xbpfiledialog.prg | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 63697d99a7..17c8128320 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-28 11:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbpfiledialog.prg + ! Fixed: a regression where QApplication():focusWidget() + was returned as a NIL instead of QWidget. + 2012-06-28 11:25 UTC+0200 Viktor Szakats (harbour syenar.net) * doc/dirstruc.txt * updated diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 7fff4c8f6a..4814abf745 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -124,6 +124,7 @@ METHOD XbpFileDialog:create( oParent, oOwner, aPos ) #endif ::oWidget:setOption( QFileDialog_DontResolveSymlinks, .t. ) + ::oWidget:setAttribute( Qt_WA_DeleteOnClose, .f. ) ::postCreate() @@ -269,7 +270,10 @@ METHOD XbpFileDialog:open( cDefaultFile, lCenter, lAllowMultiple, lCreateNewFile ::connect() nResult := ::oWidget:exec() ::disconnect() - qFocus:setFocus( 0 ) + ::oWidget:close() + IF hb_isObject( qFocus ) + qFocus:setFocus( 0 ) + ENDIF RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames( lAllowMultiple ), NIL ) @@ -320,7 +324,9 @@ METHOD XbpFileDialog:saveAs( cDefaultFile, lFileList, lCenter ) ::connect() nResult := ::oWidget:exec() ::disconnect() - qFocus:setFocus( 0 ) + IF hb_isObject( qFocus ) + qFocus:setFocus( 0 ) + ENDIF RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames(), NIL )