From f59c793514c1cbd4ef3c4ce15932da92ebd5d7c7 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 21 Oct 2010 00:16:48 +0000 Subject: [PATCH] 2010-10-20 17:02 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth * contrib/hbqt/qscintilla/qth/QsciCommand.qth * contrib/hbqt/qscintilla/qth/QsciCommandSet.qth * contrib/hbqt/qscintilla/qth/QsciLexer.qth * contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth * contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth * contrib/hbqt/qtgui/qth/QApplication.qth + Added: Constructor = no. * contrib/hbqt/qtgui/qth/QClipboard.qth + Added: Constructor = no. QClipboard() does not have constructor so it has never to be released. Maybe this fixes the bug reported on HMG forums. * contrib/hbqt/qtgui/g/QClipboard.cpp * Re-generated. * contrib/hbqt/utils/hbqtgen.prg + Introduced: ::isDetached member pulled from .qth header. --- harbour/ChangeLog | 25 +++++++++++++++++++ .../hbqt/qscintilla/qth/QsciAbstractAPIs.qth | 1 + .../hbqt/qscintilla/qth/QsciCommand.qth | 1 + .../hbqt/qscintilla/qth/QsciCommandSet.qth | 1 + .../contrib/hbqt/qscintilla/qth/QsciLexer.qth | 1 + .../qth/QDesignerActionEditorInterface.qth | 1 + .../QDesignerFormWindowCursorInterface.qth | 1 + .../qth/QDesignerFormWindowInterface.qth | 1 + .../QDesignerFormWindowManagerInterface.qth | 1 + .../qth/QDesignerObjectInspectorInterface.qth | 1 + .../qth/QDesignerPropertyEditorInterface.qth | 1 + .../qth/QDesignerWidgetBoxInterface.qth | 1 + harbour/contrib/hbqt/qtgui/g/QClipboard.cpp | 2 +- .../contrib/hbqt/qtgui/qth/QApplication.qth | 1 + harbour/contrib/hbqt/qtgui/qth/QClipboard.qth | 4 ++- harbour/contrib/hbqt/utils/hbqtgen.prg | 21 ++++++++++------ 16 files changed, 54 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c4abb4a2eb..b73b188b58 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-20 17:02 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth + * contrib/hbqt/qscintilla/qth/QsciCommand.qth + * contrib/hbqt/qscintilla/qth/QsciCommandSet.qth + * contrib/hbqt/qscintilla/qth/QsciLexer.qth + * contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth + * contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth + * contrib/hbqt/qtgui/qth/QApplication.qth + + Added: Constructor = no. + * contrib/hbqt/qtgui/qth/QClipboard.qth + + Added: Constructor = no. + QClipboard() does not have constructor so it has never to be released. + Maybe this fixes the bug reported on HMG forums. + + * contrib/hbqt/qtgui/g/QClipboard.cpp + * Re-generated. + + * contrib/hbqt/utils/hbqtgen.prg + + Introduced: ::isDetached member pulled from .qth header. + 2010-10-21 00:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbrun/hbrun.prg ! Refixed icon ordinal in file type registration. diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth index d90f50be12..67ebd636a0 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciAbstractAPIs.qth @@ -60,6 +60,7 @@ Inherits = Type = New = Folder = hbqscintilla +Constructor = no diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciCommand.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciCommand.qth index c909511f0a..8bf9065ab8 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciCommand.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciCommand.qth @@ -60,6 +60,7 @@ Inherits = Type = New = Folder = hbqscintilla +Constructor = no diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciCommandSet.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciCommandSet.qth index a9889ac8d6..d63648bae3 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciCommandSet.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciCommandSet.qth @@ -60,6 +60,7 @@ Inherits = Type = New = Folder = hbqscintilla +Constructor = no diff --git a/harbour/contrib/hbqt/qscintilla/qth/QsciLexer.qth b/harbour/contrib/hbqt/qscintilla/qth/QsciLexer.qth index f679ef904c..b378d29979 100644 --- a/harbour/contrib/hbqt/qscintilla/qth/QsciLexer.qth +++ b/harbour/contrib/hbqt/qscintilla/qth/QsciLexer.qth @@ -61,6 +61,7 @@ Type = New = Folder = hbqscintilla Destructor = no +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth index 81ff7bf847..5aaa21bc9e 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerActionEditorInterface.qth @@ -60,6 +60,7 @@ Inherits = QWidget Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth index cc91e88433..3c78b1597f 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowCursorInterface.qth @@ -60,6 +60,7 @@ Inherits = Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth index c55d26a0d9..a605b2c691 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowInterface.qth @@ -60,6 +60,7 @@ Inherits = QWidget Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth index 4bd928fc6c..2381f2a26c 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerFormWindowManagerInterface.qth @@ -60,6 +60,7 @@ Inherits = QObject Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth index aa10d3b544..dab544b5f4 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerObjectInspectorInterface.qth @@ -60,6 +60,7 @@ Inherits = QWidget Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth index 6a47ad0d6b..329b70e2f4 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerPropertyEditorInterface.qth @@ -60,6 +60,7 @@ Inherits = QWidget Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth index 60ce19c155..2f38462eac 100644 --- a/harbour/contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth +++ b/harbour/contrib/hbqt/qtdesigner/qth/QDesignerWidgetBoxInterface.qth @@ -60,6 +60,7 @@ Inherits = QWidget Type = New = folder = hbqtdesigner +Constructor = no diff --git a/harbour/contrib/hbqt/qtgui/g/QClipboard.cpp b/harbour/contrib/hbqt/qtgui/g/QClipboard.cpp index 18dbc01910..3b2385477b 100644 --- a/harbour/contrib/hbqt/qtgui/g/QClipboard.cpp +++ b/harbour/contrib/hbqt/qtgui/g/QClipboard.cpp @@ -169,7 +169,7 @@ HB_FUNC( QT_QCLIPBOARD ) pObj = QApplication::clipboard() ; - hb_retptrGC( hbqt_gcAllocate_QClipboard( ( void * ) pObj, true ) ); + hb_retptrGC( hbqt_gcAllocate_QClipboard( ( void * ) pObj, false ) ); } /* diff --git a/harbour/contrib/hbqt/qtgui/qth/QApplication.qth b/harbour/contrib/hbqt/qtgui/qth/QApplication.qth index d47d618346..855beb4e8e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QApplication.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QApplication.qth @@ -56,6 +56,7 @@ Inherit = QCoreApplication New = +Constructor = no diff --git a/harbour/contrib/hbqt/qtgui/qth/QClipboard.qth b/harbour/contrib/hbqt/qtgui/qth/QClipboard.qth index 866fa2fbeb..d543cd0fd4 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QClipboard.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QClipboard.qth @@ -59,6 +59,7 @@ Inherits = QObject Type = Core New = Destructor = no +Detached = yes @@ -73,7 +74,8 @@ Destructor = no */ HB_FUNC( QT_QCLIPBOARD ) { - __HB_RETPTRGC__( QApplication::clipboard() ); + //__HB_RETPTRGC__( QApplication::clipboard() ); + pObj = QApplication::clipboard() ; } diff --git a/harbour/contrib/hbqt/utils/hbqtgen.prg b/harbour/contrib/hbqt/utils/hbqtgen.prg index 804ee47080..75a984b04f 100644 --- a/harbour/contrib/hbqt/utils/hbqtgen.prg +++ b/harbour/contrib/hbqt/utils/hbqtgen.prg @@ -473,6 +473,7 @@ CLASS HbQtSource DATA isDestructor INIT .t. DATA isConstructor INIT .f. DATA isObject INIT .t. + DATA isDetached INIT .f. DATA areMethodsClubbed INIT .t. DATA class_ INIT {} @@ -620,18 +621,22 @@ METHOD HbQtSource:new( oGen, cFileQth, cPathOut, cPathDoc, cProject ) aeval( ::slots_, {|e| aadd( ::protos_, e ) } ) ::isList := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "list" .AND. lower( e_[ 2 ] ) == "yes" } ) > 0 + ::isDetached := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "detached" .AND. lower( e_[ 2 ] ) == "yes" } ) > 0 + ::isConstructor := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "constructor" .AND. lower( e_[ 2 ] ) == "no" } ) == 0 ::isDestructor := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "destructor" .AND. lower( e_[ 2 ] ) == "no" } ) == 0 ::isObject := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "qobject" .AND. lower( e_[ 2 ] ) == "no" } ) == 0 ::areMethodsClubbed := ascan( ::cls_, {|e_| lower( e_[ 1 ] ) == "clubmethods" .AND. lower( e_[ 2 ] ) == "no" } ) == 0 /* Determine Constructor - but this is hacky a bit. What could be easiest ? */ - FOR i := 3 TO len( ::new_ ) - 1 - IF !( left( ltrim( ::new_[ i ] ), 2 ) == "//" ) - IF "__HB_RETPTRGC__(" $ ::new_[ i ] - ::isConstructor := .t. - EXIT + IF ! ::isConstructor + FOR i := 3 TO len( ::new_ ) - 1 + IF !( left( ltrim( ::new_[ i ] ), 2 ) == "//" ) + IF "__HB_RETPTRGC__(" $ ::new_[ i ] + ::isConstructor := .t. + EXIT + ENDIF ENDIF - ENDIF - NEXT + NEXT + ENDIF FOR EACH s IN ::protos_ cOrg := s @@ -888,7 +893,7 @@ METHOD HbQtSource:build() ENDIF NEXT aadd( ::cpp_, " " ) - aadd( ::cpp_, " hb_retptrGC( hbqt_gcAllocate_" + ::cWidget + "( ( void * ) pObj, true ) );" ) + aadd( ::cpp_, " hb_retptrGC( hbqt_gcAllocate_" + ::cWidget + "( ( void * ) pObj, " + iif( ::isDetached, "false", "true" ) + " ) );" ) ELSE FOR i := 3 TO len( ::new_ ) - 1 aadd( ::cpp_, ::new_[ i ] )