2010-01-03 09:22 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbide/hbide.prg
  * contrib/hbide/idedocks.prg
  * contrib/hbide/ideeditor.prg
    % Qt_Connect_Signal( ... ) => Qt_Slots_Connect( ::pSlots, ... )
    % Qt_Connect_Events( ... ) => Qt_Events_Connect( ::pEvents, ... )
         And reverse of it.

  * contrib/hbxbp/xbpbrowse.prg
  * contrib/hbxbp/xbpdialog.prg
  * contrib/hbxbp/xbpgeneric.prg
  * contrib/hbxbp/xbplistbox.prg
  * contrib/hbxbp/xbpqtuiloader.prg
  * contrib/hbxbp/xbpsle.prg
  * contrib/hbxbp/xbpspinbutton.prg
  * contrib/hbxbp/xbptreeview.prg
  * contrib/hbxbp/xbpwindow.prg
    % Qt_Connect_Signal( ... ) => Qt_Slots_Connect( ::pSlots, ... )
    % Qt_Connect_Events( ... ) => Qt_Events_Connect( ::pEvents, ... )
         And reverse of it.

    Viktor, you may delete the previous implementation.
This commit is contained in:
Pritpal Bedi
2010-01-03 17:32:43 +00:00
parent 87e26037c0
commit 47ca2eac6c
13 changed files with 222 additions and 166 deletions

View File

@@ -17,6 +17,29 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-03 09:22 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/ideeditor.prg
% Qt_Connect_Signal( ... ) => Qt_Slots_Connect( ::pSlots, ... )
% Qt_Connect_Events( ... ) => Qt_Events_Connect( ::pEvents, ... )
And reverse of it.
* contrib/hbxbp/xbpbrowse.prg
* contrib/hbxbp/xbpdialog.prg
* contrib/hbxbp/xbpgeneric.prg
* contrib/hbxbp/xbplistbox.prg
* contrib/hbxbp/xbpqtuiloader.prg
* contrib/hbxbp/xbpsle.prg
* contrib/hbxbp/xbpspinbutton.prg
* contrib/hbxbp/xbptreeview.prg
* contrib/hbxbp/xbpwindow.prg
% Qt_Connect_Signal( ... ) => Qt_Slots_Connect( ::pSlots, ... )
% Qt_Connect_Events( ... ) => Qt_Events_Connect( ::pEvents, ... )
And reverse of it.
Viktor, you may delete the previous implementation.
2010-01-03 14:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qth/QApplication.qth
* Minor optimizations.

View File

@@ -107,6 +107,9 @@ PROCEDURE Main( cProjIni )
CLASS HbIde
ACCESS pSlots INLINE hbxbp_getSlotsPtr()
ACCESS pEvents INLINE hbxbp_GetEventsPtr()
DATA mp1, mp2, oXbp, nEvent
DATA aTabs INIT {}
DATA cProjIni
@@ -1396,9 +1399,9 @@ METHOD HbIde:printPreview()
qDlg := QPrintPreviewDialog():new( ::oDlg:oWidget )
qDlg:setWindowTitle( "Harbour-QT Preview Dialog" )
Qt_Connect_Signal( qDlg, "paintRequested(QPrinter)", {|o,p| ::paintRequested( p,o ) } )
Qt_Slots_Connect( ::pSlots, qDlg, "paintRequested(QPrinter)", {|o,p| ::paintRequested( p,o ) } )
qDlg:exec()
Qt_DisConnect_Signal( qDlg, "paintRequested(QPrinter)" )
Qt_Slots_disConnect( ::pSlots, qDlg, "paintRequested(QPrinter)" )
RETURN self
@@ -1945,9 +1948,9 @@ METHOD HbIde:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
//::qProcess:setStandardOutputFile( "c:\temp\out.out" )
//::qProcess:setStandardErrorFile( "c:\temp\err.out" )
Qt_Connect_Signal( ::qProcess, "readyReadStandardOutput()", {|o,i| ::readProcessInfo( 2, i, o ) } )
Qt_Connect_Signal( ::qProcess, "readyReadStandardError()" , {|o,i| ::readProcessInfo( 3, i, o ) } )
Qt_Connect_Signal( ::qProcess, "finished(int,int)" , {|o,i| ::readProcessInfo( 4, i, o ) } )
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardOutput()", {|o,i| ::readProcessInfo( 2, i, o ) } )
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardError()" , {|o,i| ::readProcessInfo( 3, i, o ) } )
Qt_Slots_Connect( ::pSlots, ::qProcess, "finished(int,int)" , {|o,i| ::readProcessInfo( 4, i, o ) } )
::oOutputResult:oWidget:clear()
::qProcess:start( "hbmk2", qStringList )
@@ -2052,9 +2055,9 @@ METHOD HbIde:readProcessInfo( nMode )
::oOutputResult:oWidget:append( '-----------------------------------------------------------------' )
::oOutputResult:oWidget:append( 'Finished at ' + time() )
Qt_DisConnect_Signal( ::qProcess, "finished(int,int)" )
Qt_DisConnect_Signal( ::qProcess, "readyReadStandardOutput()" )
Qt_DisConnect_Signal( ::qProcess, "readyReadStandardError()" )
Qt_Slots_disConnect( ::pSlots, ::qProcess, "finished(int,int)" )
Qt_Slots_disConnect( ::pSlots, ::qProcess, "readyReadStandardOutput()" )
Qt_Slots_disConnect( ::pSlots, ::qProcess, "readyReadStandardError()" )
::qProcess:kill()
::qProcess:pPtr := 0

View File

@@ -73,6 +73,9 @@
CLASS IdeDocks
ACCESS pSlots INLINE hbxbp_getSlotsPtr()
ACCESS pEvents INLINE hbxbp_GetEventsPtr()
DATA nPass INIT 0
DATA oIde
@@ -343,7 +346,7 @@ METHOD IdeDocks:buildOutputResults()
::oDlg:oWidget:addDockWidget_1( Qt_BottomDockWidgetArea, ::oDockB2:oWidget, Qt_Horizontal )
::oDockB2:hide()
Qt_Connect_Signal( ::oOutputResult:oWidget, "copyAvailable(bool)", {|o,l| ::outputDoubleClicked( l, o ) } )
Qt_Slots_Connect( ::pSlots, ::oOutputResult:oWidget, "copyAvailable(bool)", {|o,l| ::outputDoubleClicked( l, o ) } )
RETURN Self
@@ -363,7 +366,7 @@ METHOD IdeDocks:outputDoubleClicked( lSelected )
::oIde:editSource( cSource )
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
nLine := iif( nLine < 1, 0, nLine - 1 )
qCursor:setPosition( 0 )
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
::oIde:qCurEdit:setTextCursor( qCursor )

View File

@@ -75,6 +75,9 @@
CLASS IdeEditor
ACCESS pSlots INLINE hbxbp_getSlotsPtr()
ACCESS pEvents INLINE hbxbp_GetEventsPtr()
DATA oIde
DATA oTab
@@ -177,10 +180,10 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
::qHiliter := ::oIde:oThemes:SetSyntaxHilighting( ::qEdit, @::cTheme )
ENDIF
Qt_Connect_Signal( ::qEdit , "textChanged()" , {|| ::setTabImage() } )
Qt_Connect_Signal( ::qEdit , "cursorPositionChanged()", {|| ::dispEditInfo() } )
Qt_Slots_Connect( ::pSlots, ::qEdit , "textChanged()" , {|| ::setTabImage() } )
Qt_Slots_Connect( ::pSlots, ::qEdit , "cursorPositionChanged()", {|| ::dispEditInfo() } )
Qt_Connect_Signal( ::qDocument, "blockCountChanged(int)" , {|o,i| ::onBlockCountChanged( i, o ) } )
Qt_Slots_Connect( ::pSlots, ::qDocument, "blockCountChanged(int)" , {|o,i| ::onBlockCountChanged( i, o ) } )
::qEdit:show()
@@ -231,7 +234,7 @@ METHOD IdeEditor:destroy()
METHOD IdeEditor:removeTabPage()
LOCAL cSource := ::sourceFile
LOCAL n
n := aScan( ::oIde:aTabs, {|e_| e_[ TAB_OEDITOR ]:nID == ::nID } )
IF n > 0
@@ -245,13 +248,13 @@ METHOD IdeEditor:removeTabPage()
// { oTab, qEdit, qHiliter, qLayout, cSourceFile, qDocument }
//
IF !Empty( ::qEdit )
Qt_DisConnect_Signal( ::qEdit, "textChanged()" )
Qt_DisConnect_Signal( ::qEdit, "cursorPositionChanged()" )
Qt_Slots_disConnect( ::pSlots, ::qEdit, "textChanged()" )
Qt_Slots_disConnect( ::pSlots, ::qEdit, "cursorPositionChanged()" )
/* To avoid recursive calls on invalid pointers */
ENDIF
IF !Empty( ::qDocument )
Qt_DisConnect_Signal( ::qDocument, "blockCountChanged(int)" )
Qt_Slots_disConnect( ::pSlots, ::qDocument, "blockCountChanged(int)" )
::qDocument:pPtr := 0
::qDocument := nil
ENDIF
@@ -269,7 +272,7 @@ METHOD IdeEditor:removeTabPage()
IF !Empty( ::qEdit )
::qEdit:pPtr := 0
::qEdit := nil
::oIde:oFuncList:clear()
ENDIF
@@ -280,13 +283,13 @@ METHOD IdeEditor:removeTabPage()
ENDIF
n := aScan( ::oIde:aProjData, {|e_| e_[ 4 ] == cSource } )
IF ( n > 0 )
::oIde:aProjData[ n,3 ]:delItem( ::oIde:aProjData[ n,1 ] )
hb_aDel( ::oIde:aProjData, n, .T. )
ENDIF
n := aScan( ::oIde:aEdits, {|e_| e_:nID == ::nID } )
IF ( n > 0 )
@@ -315,13 +318,13 @@ METHOD IdeEditor:removeTabPage()
METHOD IdeEditor:buildTabPage( cSource )
::oTab := XbpTabPage():new( ::oIde:oDA, , { 5,5 }, { 700,400 }, , .t. )
IF Empty( cSource )
::oTab:caption := "Untitled " + hb_ntos( GetNextUntitled() )
ELSE
::oTab:caption := ::cFile + ::cExt
ENDIF
::oTab:minimized := .F.
::oTab:create()

View File

@@ -593,7 +593,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::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 ) } )
::connect( ::oTableView:pPtr, "scrollContentsBy(int,int)" , {|o,p,p1| ::exeBlock(11, p, p1, o ) } )
/* Finetune Horizontal Scrollbar */
::oTableView:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff )

View File

@@ -171,7 +171,7 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
hbxbp_SetEventLoop( ::oEventLoop )
/* Instal Event Filter */
::oWidget:installEventFilter( QT_GetEventFilter() )
::oWidget:installEventFilter( ::pEvents )
::connectWindowEvents()
//

View File

@@ -89,6 +89,9 @@ THREAD STATIC t_oAppWindow
THREAD STATIC t_oEventLoop
THREAD STATIC t_qtSlots
THREAD STATIC t_qtEvents
THREAD STATIC t_oXbpInFocus
/*----------------------------------------------------------------------*/
@@ -113,12 +116,30 @@ EXIT PROCEDURE hbxbp_End()
RETURN
/*----------------------------------------------------------------------*/
FUNCTION hbxbp_getSlotsPtr()
RETURN t_qtSlots
/*----------------------------------------------------------------------*/
FUNCTION hbxbp_getEventsPtr()
RETURN t_qtEvents
/*----------------------------------------------------------------------*/
/*
* Will be called from XbpDialog() | XbpCRT()
*/
FUNCTION hbxbp_InitializeEventBuffer()
IF empty( t_qtSlots )
t_qtSlots := Qt_Slots_New()
ENDIF
IF empty( t_qtEvents )
t_qtEvents := Qt_Events_New()
ENDIF
IF empty( t_events )
t_events := array( EVENT_BUFFER )
aeval( t_events, {|e,i| HB_SYMBOL_UNUSED( e ), t_events[ i ] := { 0, NIL, NIL, NIL } } )

View File

@@ -179,7 +179,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oWidget:setMouseTracking( .t. )
/* Window Events */
::oWidget:installEventFilter( QT_GetEventFilter() )
::oWidget:installEventFilter( ::pEvents )
::connectEvent( ::pWidget, QEvent_ContextMenu, {|o,e| ::grabEvent( QEvent_ContextMenu, e, o ) } )
/* Signal-slots */

View File

@@ -132,11 +132,11 @@ METHOD XbpQtUiLoader:destroy()
LOCAL a_
FOR EACH a_ IN ::aSignals
Qt_DisConnect_Signal( a_[ 1 ], a_[ 2 ] )
Qt_Slots_disConnect( ::pSlots, a_[ 1 ], a_[ 2 ] )
NEXT
FOR EACH a_ IN ::aEvents
Qt_DisConnect_Event( a_[ 1 ], a_[ 2 ] )
Qt_Events_disConnect( ::pEvents, a_[ 1 ], a_[ 2 ] )
NEXT
::oWidget:hide()
@@ -149,7 +149,7 @@ METHOD XbpQtUiLoader:destroy()
METHOD XbpQtUiLoader:event( cWidget, nEvent, bBlock )
IF hb_hHasKey( ::qObj, cWidget )
IF Qt_Connect_Signal( ::qObj[ cWidget ], nEvent, bBlock )
IF Qt_Events_Connect( ::pEvents, ::qObj[ cWidget ], nEvent, bBlock )
aadd( ::aEvents, { ::qObj[ cWidget ], nEvent } )
ENDIF
ENDIF
@@ -161,7 +161,7 @@ METHOD XbpQtUiLoader:event( cWidget, nEvent, bBlock )
METHOD XbpQtUiLoader:signal( cWidget, cSignal, bBlock )
IF hb_hHasKey( ::qObj, cWidget )
IF Qt_Connect_Signal( ::qObj[ cWidget ], cSignal, bBlock )
IF Qt_Slots_Connect( ::pSlots, ::qObj[ cWidget ], cSignal, bBlock )
aadd( ::aSignals, { ::qObj[ cWidget ], cSignal } )
ENDIF
ENDIF

View File

@@ -147,7 +147,7 @@ METHOD XbpSLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oWidget:setMaxLength( ::bufferLength )
#if 0
QT_QObject_InstallEventFilter( ::pWidget, QT_GetEventFilter() )
::oWidget:installEventFilter( ::pEvents )
::connectEvent( ::pWidget, QEvent_FocusIn , {|o,e| ::exeBlock( 7, e, o ) } )
::connectEvent( ::pWidget, QEvent_FocusOut, {|o,e| ::exeBlock( 8, e, o ) } )

View File

@@ -155,7 +155,8 @@ METHOD XbpSpinButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::oWidget:setAlignment( es_[ ::align ] )
#if 0 ////////////////////////////////////
QT_QObject_InstallEventFilter( ::pWidget, QT_GetEventFilter() )
::oWidget:installEventFilter( ::pEvents )
HBXBP_DEBUG( "XbpSpinButton:create 2" )
::connectEvent( ::pWidget, QEvent_FocusIn , {|o,e| ::exeBlock( 7, e, o ) } )
::connectEvent( ::pWidget, QEvent_FocusOut, {|o,e| ::exeBlock( 8, e, o ) } )

View File

@@ -169,7 +169,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oRootItem:oWidget := oW
/* Window Events */
::oWidget:installEventFilter( QT_GetEventFilter() )
::oWidget:installEventFilter( ::pEvents )
::connectEvent( ::pWidget, QEvent_ContextMenu, {|o,e| ::grabEvent( QEvent_ContextMenu, e, o ) } )
//::connect( ::pWidget, "currentItemChanged(QTWItem)" , {|o,p1,p2| ::exeBlock( 1, p1, p2, o ) } )

View File

@@ -255,7 +255,7 @@ EXPORTED:
DATA nWndProc
DATA oMenu
METHOD HandleEvent()
METHOD handleEvent()
METHOD grabEvent()
METHOD isDerivedFrom()
@@ -284,6 +284,9 @@ EXPORTED:
METHOD hbContextMenu SETGET
ACCESS pSlots INLINE hbxbp_getSlotsPtr()
ACCESS pEvents INLINE hbxbp_GetEventsPtr()
ENDCLASS
/*----------------------------------------------------------------------*/
@@ -395,18 +398,36 @@ METHOD XbpWindow:setQtProperty( cProperty )
METHOD XbpWindow:connect( pWidget, cSignal, bBlock )
LOCAL lSuccess
IF ( lSuccess := Qt_Connect_Signal( pWidget, cSignal, bBlock ) )
IF ( lSuccess := Qt_Slots_Connect( ::pSlots, pWidget, cSignal, bBlock ) )
aadd( ::aConnections, { pWidget, cSignal } )
ELSE
// HB_TRACE( HB_TR_ALWAYS, ( " Connection failed %s", cSignal ) )
HB_TRACE( HB_TR_ALWAYS, ( " " + cSignal ) )
ENDIF
RETURN lSuccess
/*----------------------------------------------------------------------*/
METHOD XbpWindow:disconnect()
LOCAL e_
IF len( ::aConnections ) > 0
FOR EACH e_ IN ::aConnections
::xDummy := Qt_Slots_DisConnect( ::pSlots, e_[ 1 ], e_[ 2 ] )
// HBXBP_DEBUG( " Signal Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] )
NEXT
::aConnections := {}
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:connectEvent( pWidget, nEvent, bBlock )
LOCAL lSuccess
IF ( lSuccess := Qt_Connect_Event( pWidget, nEvent, bBlock ) )
IF ( lSuccess := Qt_Events_Connect( ::pEvents, hbqt_ptr( pWidget ), nEvent, bBlock ) )
aadd( ::aEConnections, { pWidget, nEvent } )
ENDIF
@@ -442,9 +463,117 @@ METHOD XbpWindow:connectWindowEvents()
RETURN Self
/*----------------------------------------------------------------------*/
/*
:quit()
*/
METHOD XbpWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
DEFAULT oParent TO ::oParent
DEFAULT oOwner TO ::oOwner
DEFAULT aPos TO ::aPos
DEFAULT aSize TO ::sSize
DEFAULT aPresParams TO ::aPresParams
DEFAULT lVisible TO ::visible
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:destroy()
LOCAL e_
LOCAL cXbp := __ObjGetClsName( self )
//HBXBP_DEBUG( ". " )
//HBXBP_DEBUG( hb_threadId(),"Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
IF cXbp == "XBPDIALOG"
hbxbp_SetEventLoop( NIL )
::oEventLoop:exit( 0 )
::oEventLoop:pPtr := 0
SetAppWindow( XbpObject():new() )
::oMenu := NIL
ENDIF
::disconnect()
IF len( ::aEConnections ) > 0
FOR EACH e_ IN ::aEConnections
::xDummy := Qt_Events_DisConnect( ::pEvents, e_[ 1 ], e_[ 2 ] )
// HBXBP_DEBUG( "Event Disconnect:", iif( ::xDummy, "SUCCEEDED", "FAILED " ), e_[ 1 ], e_[ 2 ] )
NEXT
::aEConnections := {}
::oWidget:removeEventFilter( QT_GetEventFilter() )
ENDIF
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {|o| o:destroy() } )
::aChildren := {}
ENDIF
::XbpPartHandler:destroy()
::clearSlots()
IF cXbp == "XBPDIALOG"
hbxbp_ClearEventBuffer()
ENDIF
::oWidget:pPtr := 0
::oWidget := NIL
//HBXBP_DEBUG( hb_threadId()," Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
RETURN NIL
/*----------------------------------------------------------------------*/
METHOD XbpWindow:clearSlots()
LOCAL i
::sl_enter := NIL
::sl_leave := NIL
::sl_lbClick := NIL
::sl_lbDblClick := NIL
::sl_lbDown := NIL
::sl_lbUp := NIL
::sl_mbClick := NIL
::sl_mbDblClick := NIL
::sl_mbDown := NIL
::sl_mbUp := NIL
::sl_motion := NIL
::sl_rbClick := NIL
::sl_rbDblClick := NIL
::sl_rbDown := NIL
::sl_rbUp := NIL
::sl_wheel := NIL
::sl_helpRequest := NIL
::sl_keyboard := NIL
::sl_killInputFocus := NIL
::sl_move := NIL
::sl_paint := NIL
::sl_quit := NIL
::sl_resize := NIL
::sl_setInputFocus := NIL
::sl_dragEnter := NIL
::sl_dragMotion := NIL
::sl_dragLeave := NIL
::sl_dragDrop := NIL
::sl_close := NIL
::sl_setDisplayFocus := NIL
::sl_killDisplayFocus := NIL
IF !empty( ::aPresParams )
FOR i := 1 TO len( ::aPresParams )
::aPresParams[ i,1 ] := NIL
::aPresParams[ i,2 ] := NIL
::aPresParams[ i ] := NIL
NEXT
ENDIF
::aPresParams := NIL
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:grabEvent( nEvent, pEvent, oXbp )
LOCAL oEvent, nXbpKey, oP0, oP1, oObj_O, oObj_N
LOCAL lRet := .t.
@@ -726,133 +855,6 @@ METHOD XbpWindow:handleEvent( nEvent, mp1, mp2 )
/*----------------------------------------------------------------------*/
METHOD XbpWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
DEFAULT oParent TO ::oParent
DEFAULT oOwner TO ::oOwner
DEFAULT aPos TO ::aPos
DEFAULT aSize TO ::sSize
DEFAULT aPresParams TO ::aPresParams
DEFAULT lVisible TO ::visible
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:destroy()
LOCAL e_
LOCAL cXbp := __ObjGetClsName( self )
//HBXBP_DEBUG( ". " )
//HBXBP_DEBUG( hb_threadId(),"Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
IF cXbp == "XBPDIALOG"
hbxbp_SetEventLoop( NIL )
::oEventLoop:exit( 0 )
::oEventLoop:pPtr := 0
SetAppWindow( XbpObject():new() )
::oMenu := NIL
ENDIF
::disconnect()
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 ] )
NEXT
::aEConnections := {}
::oWidget:removeEventFilter( QT_GetEventFilter() )
ENDIF
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {|o| o:destroy() } )
::aChildren := {}
ENDIF
::XbpPartHandler:destroy()
::clearSlots()
IF cXbp == "XBPDIALOG"
hbxbp_ClearEventBuffer()
Qt_Slots_Destroy()
Qt_Events_Destroy()
ENDIF
::oWidget:pPtr := 0
::oWidget := NIL
//HBXBP_DEBUG( hb_threadId()," Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
RETURN NIL
/*----------------------------------------------------------------------*/
METHOD XbpWindow:disconnect()
LOCAL e_
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 ] )
NEXT
::aConnections := {}
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:clearSlots()
LOCAL i
::sl_enter := NIL
::sl_leave := NIL
::sl_lbClick := NIL
::sl_lbDblClick := NIL
::sl_lbDown := NIL
::sl_lbUp := NIL
::sl_mbClick := NIL
::sl_mbDblClick := NIL
::sl_mbDown := NIL
::sl_mbUp := NIL
::sl_motion := NIL
::sl_rbClick := NIL
::sl_rbDblClick := NIL
::sl_rbDown := NIL
::sl_rbUp := NIL
::sl_wheel := NIL
::sl_helpRequest := NIL
::sl_keyboard := NIL
::sl_killInputFocus := NIL
::sl_move := NIL
::sl_paint := NIL
::sl_quit := NIL
::sl_resize := NIL
::sl_setInputFocus := NIL
::sl_dragEnter := NIL
::sl_dragMotion := NIL
::sl_dragLeave := NIL
::sl_dragDrop := NIL
::sl_close := NIL
::sl_setDisplayFocus := NIL
::sl_killDisplayFocus := NIL
IF !empty( ::aPresParams )
FOR i := 1 TO len( ::aPresParams )
::aPresParams[ i,1 ] := NIL
::aPresParams[ i,2 ] := NIL
::aPresParams[ i ] := NIL
NEXT
ENDIF
::aPresParams := NIL
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:captureMouse( lCapture )
LOCAL lSuccess := .f.