From 632842e7dbf80133ed42d20956b9ec51792f133c Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 19 Dec 2009 16:56:49 +0000 Subject: [PATCH] 2009-12-19 08:15 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbpbrowse.prg * contrib/hbxbp/xbprtf.prg * contrib/hbxbp/xbpwindow.prg ! Removed all QT_PTROF() macro calls. --- harbour/ChangeLog | 6 +++++ harbour/contrib/hbxbp/xbpbrowse.prg | 34 ++++++++++++++--------------- harbour/contrib/hbxbp/xbprtf.prg | 2 +- harbour/contrib/hbxbp/xbpwindow.prg | 9 ++++---- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5b147408e6..c55796a7d7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-19 08:15 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbprtf.prg + * contrib/hbxbp/xbpwindow.prg + ! Removed all QT_PTROF() macro calls. + 2009-12-19 16:52 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/thread.c * added hb_threadOnceInit() to .prg function list diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 6185428729..0634e6c70f 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -514,9 +514,9 @@ METHOD XbpBrowse:buildLeftFreeze() // //::oLeftFooterView:hide() - ::connect( QT_PTROF( ::oLeftView ) , "mousePressEvent()" , {|o,p| ::exeBlock( 31, p, o ) } ) - ::connect( QT_PTROF( ::oLeftHeaderView ), "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) - ::connect( QT_PTROF( ::oLeftFooterView ), "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) + ::connect( ::oLeftView , "mousePressEvent()" , {|o,p| ::exeBlock( 31, p, o ) } ) + ::connect( ::oLeftHeaderView, "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) + ::connect( ::oLeftFooterView, "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) RETURN Self @@ -560,9 +560,9 @@ METHOD XbpBrowse:buildRightFreeze() ::oRightFooterModel := HBDbfModel():new( {|p1,p2,p3,p4| ::supplyInfo( 162, p1, p2, p3, p4 ) } ) ::oRightFooterView:setModel( ::oRightFooterModel ) - ::connect( QT_PTROF( ::oRightView ) , "mousePressEvent()" , {|o,p| ::exeBlock( 31, p, o ) } ) - ::connect( QT_PTROF( ::oRightHeaderView ), "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) - ::connect( QT_PTROF( ::oRightFooterView ), "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) + ::connect( ::oRightView , "mousePressEvent()" , {|o,p| ::exeBlock( 31, p, o ) } ) + ::connect( ::oRightHeaderView, "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) + ::connect( ::oRightFooterView, "sectionPressed(int)", {|o,i| ::exeBlock( 31, i, o ) } ) RETURN Self @@ -589,27 +589,27 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oTableView:setSelectionBehavior( IF( ::cursorMode == XBPBRW_CURSOR_ROW, QAbstractItemView_SelectRows, QAbstractItemView_SelectItems ) ) /* Connect Keyboard Events */ - ::connect( QT_PTROF( ::oTableView ), "keyPressEvent()" , {|o,p | ::exeBlock( 1, p, o ) } ) - ::connect( QT_PTROF( ::oTableView ), "mousePressEvent()" , {|o,p | ::exeBlock( 2, p, o ) } ) - ::connect( QT_PTROF( ::oTableView ), "mouseDoubleClickEvent()" , {|o,p | ::exeBlock( 3, p, o ) } ) - ::connect( QT_PTROF( ::oTableView ), "wheelEvent()" , {|o,p | ::exeBlock( 4, p, o ) } ) - ::connect( QT_PTROF( ::oTableView ), "scrollContentsBy(int,int)" , {|o,p,p1| ::exeBlock(11, p, p1, o ) } ) + ::connect( ::oTableView, "keyPressEvent()" , {|o,p | ::exeBlock( 1, p, o ) } ) + ::connect( ::oTableView, "mousePressEvent()" , {|o,p | ::exeBlock( 2, p, o ) } ) + ::connect( ::oTableView, "mouseDoubleClickEvent()" , {|o,p | ::exeBlock( 3, p, o ) } ) + ::connect( ::oTableView, "wheelEvent()" , {|o,p | ::exeBlock( 4, p, o ) } ) + ::connect( ::oTableView, "scrollContentsBy(int,int)" , {|o,p,p1| ::exeBlock(11, p, p1, o ) } ) /* Finetune Horizontal Scrollbar */ ::oTableView:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) // ::oHScrollBar := QScrollBar():new() ::oHScrollBar:setOrientation( Qt_Horizontal ) - ::connect( QT_PTROF( ::oHScrollBar ), "actionTriggered(int)" , {|o,i| ::exeBlock( 103, i, o ) } ) - ::connect( QT_PTROF( ::oHScrollBar ), "sliderReleased()" , {|o,i| ::exeBlock( 104, i, o ) } ) + ::connect( ::oHScrollBar, "actionTriggered(int)" , {|o,i| ::exeBlock( 103, i, o ) } ) + ::connect( ::oHScrollBar, "sliderReleased()" , {|o,i| ::exeBlock( 104, i, o ) } ) /* Replace Vertical Scrollbar with our own */ ::oTableView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) // ::oVScrollBar := QScrollBar():new() ::oVScrollBar:setOrientation( Qt_Vertical ) - ::connect( QT_PTROF( ::oVScrollBar ), "actionTriggered(int)" , {|o,i| ::exeBlock( 101, i, o ) } ) - ::connect( QT_PTROF( ::oVScrollBar ), "sliderReleased()" , {|o,i| ::exeBlock( 102, i, o ) } ) + ::connect( ::oVScrollBar, "actionTriggered(int)" , {|o,i| ::exeBlock( 101, i, o ) } ) + ::connect( ::oVScrollBar, "sliderReleased()" , {|o,i| ::exeBlock( 102, i, o ) } ) /* Veritical Header because of Performance boost */ ::oVHeaderView := QHeaderView() @@ -621,8 +621,8 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oHeaderView:configure( ::oTableView:horizontalHeader() ) ::oHeaderView:setHighlightSections( .F. ) // - ::connect( QT_PTROF( ::oHeaderView ), "sectionPressed(int)" , {|o,i | ::exeBlock( 111, i, o ) } ) - ::connect( QT_PTROF( ::oHeaderView ), "sectionResized(int,int,int)", {|o,i,i1,i2| ::exeBlock( 121, i, i1, i2, o ) } ) + ::connect( ::oHeaderView, "sectionPressed(int)" , {|o,i | ::exeBlock( 111, i, o ) } ) + ::connect( ::oHeaderView, "sectionResized(int,int,int)", {|o,i,i1,i2| ::exeBlock( 121, i, i1, i2, o ) } ) /* .DBF Manipulation Model */ ::oDbfModel := HBDbfModel():new( {|p1,p2,p3,p4| ::supplyInfo( 141, p1, p2, p3, p4 ) } ) diff --git a/harbour/contrib/hbxbp/xbprtf.prg b/harbour/contrib/hbxbp/xbprtf.prg index 24a0a78fa0..bbeb291afb 100644 --- a/harbour/contrib/hbxbp/xbprtf.prg +++ b/harbour/contrib/hbxbp/xbprtf.prg @@ -484,7 +484,7 @@ METHOD XbpRtf:selColor( ... ) xRet := ::oTextCharFormat:foreground() nColor := hbxbp_ConvertAFactFromXBP( "COLOR", aP[ 1 ] ) oColor := QColor():new( nColor ) - oBrush := QBrush():new( "QColor", QT_PTROF( oColor ) ) + oBrush := QBrush():new( "QColor", oColor ) ::oTextCharFormat:setForeground( oBrush ) ::oCurCursor:setCharFormat( ::oTextCharFormat ) ENDIF diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 7a9df1bf24..28a447e7f9 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -259,8 +259,8 @@ EXPORTED: METHOD isDerivedFrom() DATA oWidget - ACCESS pWidget INLINE IF( empty( ::oWidget ), NIL, QT_PTROF( ::oWidget ) ) - ACCESS pParent INLINE IF( empty( ::oParent ), NIL, QT_PTROF( ::oParent:oWidget ) ) + ACCESS pWidget INLINE IF( empty( ::oWidget ), NIL, ::oWidget:pPtr ) + ACCESS pParent INLINE IF( empty( ::oParent ), NIL, ::oParent:oWidget:pPtr ) DATA oTabWidget DATA aTabs INIT {} DATA oPalette @@ -404,9 +404,8 @@ METHOD XbpWindow:connect( pWidget, cSignal, bBlock ) METHOD XbpWindow:connectEvent( pWidget, nEvent, bBlock ) LOCAL lSuccess - IF ( lSuccess := Qt_Connect_Event( hbqt_ptr( pWidget ), nEvent, bBlock ) ) -//hbxbp_debug( "Event Connected", nEvent ) - aadd( ::aEConnections, { hbqt_ptr( pWidget ), nEvent } ) + IF ( lSuccess := Qt_Connect_Event( pWidget, nEvent, bBlock ) ) + aadd( ::aEConnections, { pWidget, nEvent } ) ENDIF RETURN lSuccess