2009-11-14 23:16 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbqt/hbqt.ch
  * contrib/hbqt/tests/demoqt.prg
    + Changed to use same .prg level debug trace call method as in hbxbp.
      Enable it with __HB_OUTDEBUG__.
      On Windows to use OutputDebugString() instead of regular Harbour 
      trace calls, also #define __HB_WINDEBUG__. In this case, also link 
      hbwin lib (not xhb lib).
    * Moved QT_PTROF() macro from demo code to header.
This commit is contained in:
Viktor Szakats
2009-11-14 22:17:07 +00:00
parent b2b24c3210
commit 6340b87373
3 changed files with 31 additions and 17 deletions

View File

@@ -17,6 +17,16 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-14 23:16 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/hbqt.ch
* contrib/hbqt/tests/demoqt.prg
+ Changed to use same .prg level debug trace call method as in hbxbp.
Enable it with __HB_OUTDEBUG__.
On Windows to use OutputDebugString() instead of regular Harbour
trace calls, also #define __HB_WINDEBUG__. In this case, also link
hbwin lib (not xhb lib).
* Moved QT_PTROF() macro from demo code to header.
2009-11-14 12:16 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/tests/demoqt.prg
! Fixed to excluse non-working components and streamlined hb_toOutDebug().

View File

@@ -67,6 +67,18 @@
#ifndef _HBQT_CH
#if defined( __HB_OUTDEBUG__ )
#if defined( __PLATFORM__WINDOWS ) .AND. defined( __HB_WINDEBUG__ )
#xtranslate HB_OUTDEBUG( [<x>] ) => wapi_OutputDebugString( <x> )
#else
#xtranslate HB_OUTDEBUG( [<x>] ) => hb_TraceString( <x> )
#endif
#else
#xtranslate HB_OUTDEBUG( [<x>] ) => iif( .T.,, )
#endif
#define QT_PTROF( oObj ) ( oObj:pPtr )
#define QEvent_None 0 // Not an event.
#define QEvent_Timer 1 // Regular timer events (QTimerEvent).
#define QEvent_MouseButtonPress 2 // Mouse press (QMouseEvent).

View File

@@ -52,7 +52,7 @@
*/
/*----------------------------------------------------------------------*/
#define QT_PTROF( oObj ) ( oObj:pPtr )
#include "hbqt.ch"
#define QT_EVE_TRIGGERED "triggered()"
#define QT_EVE_TRIGGERED_B "triggered(bool)"
@@ -100,18 +100,10 @@ EXIT PROCEDURE Qt_End()
/*----------------------------------------------------------------------*/
FUNCTION My_Events()
q_toOutDebug( "Key Pressed" )
HB_OUTDEBUG( "Key Pressed" )
RETURN nil
/*----------------------------------------------------------------------*/
#ifdef __PLATFORM__WINDOWS
FUNCTION q_toOutDebug( ... )
hb_toOutDebug( ... )
RETURN nil
#else
RETURN nil
#endif
/*----------------------------------------------------------------------*/
PROCEDURE Main()
Local oLabel, oBtn, oDA, oWnd, oProg, oSBar, i
@@ -122,8 +114,8 @@ PROCEDURE Main()
Qt_SetEventFilter()
Qt_SetEventSlots()
q_toOutDebug( " " )
q_toOutDebug( "-----------------b-----------------" )
HB_OUTDEBUG( " " )
HB_OUTDEBUG( "-----------------b-----------------" )
FOR i := 1 TO 1
oWnd := QMainWindow():new()
@@ -157,17 +149,17 @@ q_toOutDebug( "-----------------b-----------------" )
oProg := Build_ProgressBar( oDA, { 30,300 }, { 200,30 } )
aList := Build_ListBox( oDA, { 310,240 }, { 150, 100 } )
q_toOutDebug( "connected: %s", IF( QT_CONNECT_EVENT( QT_PTROF( oWnd ), 6, {|o,e| My_Events( o, e ) } ), "Yes", "No" ) )
HB_OUTDEBUG( "connected: " + IIF( QT_CONNECT_EVENT( QT_PTROF( oWnd ), 6, {|o,e| My_Events( o, e ) } ), "Yes", "No" ) )
oWnd:Show()
qApp:exec()
q_toOutDebug( "----------------- qApp:exec -----------------" )
HB_OUTDEBUG( "----------------- qApp:exec -----------------" )
xReleaseMemory( { oBtn, oLabel, oProg, oSBar, aGrid, aList, aMenu, aTool, aTabs, oDA, oWnd } )
q_toOutDebug( "-------------------- exit -------------------" )
HB_OUTDEBUG( "-------------------- exit -------------------" )
RETURN
@@ -176,7 +168,7 @@ q_toOutDebug( "-------------------- exit -------------------" )
FUNCTION xReleaseMemory( aObj )
#if 1
LOCAL i
q_toOutDebug( "----------------- Releasing Memory -----------------" )
HB_OUTDEBUG( "----------------- Releasing Memory -----------------" )
FOR i := 1 TO len( aObj )
IF hb_isObject( aObj[ i ] )
aObj[ i ]:pPtr := 1
@@ -184,7 +176,7 @@ q_toOutDebug( "----------------- Releasing Memory -----------------" )
xReleaseMemory( aObj[ i ] )
ENDIF
NEXT
q_toOutDebug( "------------------ Memory Released ------------------" )
HB_OUTDEBUG( "------------------ Memory Released ------------------" )
#else
HB_SYMBOL_UNUSED( aObj )
#endif