From 7c0a62ab17f411ef2d5eff6fbe79bc685c2b95e9 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 19 Dec 2009 00:05:16 +0000 Subject: [PATCH] 2009-12-18 16:01 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/generator/hbqtgen.prg * contrib/hbide/hbide.prg * contrib/hbqt/tests/demoqt.prg * contrib/hbxbp/xbpstatic.prg * contrib/hbxbp/xbpwindow.prg + Implemented passing HBQT objects to METHOD QSomeObj:new(...). Now there is seldome a need to use QT_PTROF() macro. demoxbp/demoqt/hbide are working perfectly. [ Regenerated sources follow ] --- harbour/ChangeLog | 12 ++++++++++++ harbour/contrib/hbide/hbide.prg | 8 ++++---- harbour/contrib/hbqt/generator/hbqtgen.prg | 12 ++++++++++-- harbour/contrib/hbqt/tests/demoqt.prg | 8 ++++---- harbour/contrib/hbxbp/xbpstatic.prg | 2 +- harbour/contrib/hbxbp/xbpwindow.prg | 4 ++-- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cd776cebbe..f0bcaa55fd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-18 16:01 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/generator/hbqtgen.prg + * contrib/hbide/hbide.prg + * contrib/hbqt/tests/demoqt.prg + * contrib/hbxbp/xbpstatic.prg + * contrib/hbxbp/xbpwindow.prg + + Implemented passing HBQT objects to METHOD QSomeObj:new(...). + Now there is seldome a need to use QT_PTROF() macro. + demoxbp/demoqt/hbide are working perfectly. + + [ Regenerated sources follow ] + 2009-12-18 13:04 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbpwindow.prg ! Fixed "lSuccess" issue. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index d5f2102363..757e9cbbd9 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -360,15 +360,15 @@ METHOD HbIde:create( cProjIni ) ENDDO /* Very important - destroy resources */ - HBXBP_DEBUG( "------------------------------------------------------" ) + HBXBP_DEBUG( "======================================================" ) HBXBP_DEBUG( "Before ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) - HBXBP_DEBUG( "------------------------------------------------------" ) + HBXBP_DEBUG( " " ) ::oDlg:destroy() - HBXBP_DEBUG( "------------------------------------------------------" ) + HBXBP_DEBUG( " " ) HBXBP_DEBUG( "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) - HBXBP_DEBUG( "------------------------------------------------------" ) + HBXBP_DEBUG( "======================================================" ) ::qCursor:pPtr := 0 ::oFont := NIL diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 873c1d17c6..a2546b1aca 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -1609,8 +1609,16 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut, subCls_ ) DO CASE CASE cClassType == "PLAINOBJECT" aadd( txt_, 'METHOD ' + cWidget + ':new( ... )' ) - aadd( txt_, '' ) - aadd( txt_, ' ::pPtr := Qt_' + cWidget + '( ... )' ) + aadd( txt_, ' LOCAL p, aP := hb_aParams()' ) + aadd( txt_, ' ' ) + aadd( txt_, ' IF len( aP ) > 0' ) + aadd( txt_, ' FOR EACH p IN aP' ) + aadd( txt_, ' p := hbqt_ptr( p )' ) + aadd( txt_, ' NEXT' ) + aadd( txt_, ' ENDIF' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ::pPtr := hb_ExecFromArray( @Qt_' + cWidget + '(), aP )' ) + //aadd( txt_, ' ::pPtr := Qt_' + cWidget + '( ... )' ) aadd( txt_, '' ) aadd( txt_, ' RETURN Self' ) aadd( txt_, '' ) diff --git a/harbour/contrib/hbqt/tests/demoqt.prg b/harbour/contrib/hbqt/tests/demoqt.prg index 539d591cc6..2ce165edd3 100644 --- a/harbour/contrib/hbqt/tests/demoqt.prg +++ b/harbour/contrib/hbqt/tests/demoqt.prg @@ -469,7 +469,7 @@ STATIC FUNCTION Build_TreeView( oWnd ) oTV := QTreeView():new( oWnd ) oTV:setMouseTracking( .t. ) - //Qt_Connect_Signal( QT_PTROF( oTV ), QT_EVE_HOVERED, {|o,i| HBQT_DEBUG( "oTV:hovered" ) } ) + //Qt_Connect_Signal( oTV, QT_EVE_HOVERED, {|o,i| HBQT_DEBUG( "oTV:hovered" ) } ) oDirModel := QDirModel():new() oTV:setModel( oDirModel ) oTV:move( 5, 7 ) @@ -485,7 +485,7 @@ STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) oListBox := QListView():New( oWnd ) oListBox:setMouseTracking( .t. ) - //Qt_Connect_Signal( QT_PTROF( oListBox ), QT_EVE_HOVERED, {|o,i| HBQT_DEBUG( "oListBox:hovered" ) } ) + //Qt_Connect_Signal( oListBox, QT_EVE_HOVERED, {|o,i| HBQT_DEBUG( "oListBox:hovered" ) } ) oStrList := QStringList():new() @@ -540,7 +540,7 @@ STATIC FUNCTION Build_Controls( oWnd ) oComboBox:addItem( "First" ) oComboBox:addItem( "Second" ) oComboBox:addItem( "Third" ) - //Qt_Connect_Signal( QT_PTROF( oComboBox ), QT_EVE_HIGHLIGHTED_I , {|o,i| HBQT_DEBUG( oComboBox:itemText( i ) ) } ) + //Qt_Connect_Signal( oComboBox, QT_EVE_HIGHLIGHTED_I , {|o,i| HBQT_DEBUG( oComboBox:itemText( i ) ) } ) Qt_Connect_Signal( oComboBox, QT_EVE_CURRENTINDEXCHANGED_I, {|o,i| o := o, i := i, MsgInfo( oComboBox:itemText( i ) ) } ) oComboBox:move( 5, 60 ) oComboBox:resize( 345, 30 ) @@ -924,7 +924,7 @@ FUNCTION ShowInSystemTray( oWnd ) oMenu:addSeparator() Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Hide" ), QT_EVE_TRIGGERED_B, {|| oWnd:hide() } ) - oSys := QSystemTrayIcon():new( QT_PTROF( oWnd ) ) + oSys := QSystemTrayIcon():new( oWnd ) oSys:setIcon( 'new.png' ) oSys:setContextMenu( oMenu ) oSys:showMessage( "Harbour-QT", "This is Harbour-QT System Tray" ) diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg index a125c66548..aeb45244e7 100644 --- a/harbour/contrib/hbxbp/xbpstatic.prg +++ b/harbour/contrib/hbxbp/xbpstatic.prg @@ -365,7 +365,7 @@ METHOD XbpStatic:setCaption( xCaption, cDll ) IF ::options == XBPSTATIC_BITMAP_SCALED ::oWidget:setScaledContents( .t. ) ENDIF - ::oWidget:setPixmap( QPixmap():fromImage( QT_PTROF( ::caption:oWidget ) ) ) + ::oWidget:setPixmap( QPixmap():fromImage( ::caption:oWidget ) ) ELSEIF hb_isChar( ::caption ) /* $HARBOUR$ */ IF ::options == XBPSTATIC_BITMAP_SCALED diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index f718f494d4..7a9df1bf24 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -753,7 +753,7 @@ METHOD XbpWindow:destroy() IF len( ::aEConnections ) > 0 FOR EACH e_ IN ::aEConnections ::xDummy := Qt_DisConnect_Event( e_[ 1 ], e_[ 2 ] ) - hbxbp_debug( "Event Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] ) +// HBXBP_DEBUG( "Event Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] ) NEXT ::aEConnections := {} ::oWidget:removeEventFilter( QT_GetEventFilter() ) @@ -788,7 +788,7 @@ METHOD XbpWindow:disconnect() IF len( ::aConnections ) > 0 FOR EACH e_ IN ::aConnections ::xDummy := Qt_DisConnect_Signal( e_[ 1 ], e_[ 2 ] ) - hbxbp_debug( " Signal Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] ) +// HBXBP_DEBUG( " Signal Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] ) NEXT ::aConnections := {} ENDIF