2011-03-10 16:07 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtcore/hbqt_misc.prg
    + Added and experimental function scheduled to be removed.
  * contrib/hbqt/qtcore/hbqtcore.hbx
  * contrib/hbqt/qtdesigner/hbqtdesigner.hbx
  * contrib/hbqt/qtgui/hbqtgui.hbx
  * contrib/hbqt/qtnetwork/hbqtnetwork.hbx
  * contrib/hbqt/qtuitools/hbqtuitools.hbx
  * contrib/hbqt/qtwebkit/hbqtwebkit.hbx
  * contrib/hbqt/hbmk2_qt.hbs
    + Implemented: removed the need of any PRG wrapper to Q*Class() calls.
      Shifted to C++ level.
      NOTE: still corresponding blank .prg(s) are created inside .hbmk 
      folders. I could not follow the logic to remove them from build 
      process, Viktor ?
This commit is contained in:
Pritpal Bedi
2011-03-11 00:12:24 +00:00
parent 41465028f7
commit c84a375710
9 changed files with 71 additions and 44 deletions

View File

@@ -16,6 +16,22 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-03-10 16:07 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/hbqt_misc.prg
+ Added and experimental function scheduled to be removed.
* contrib/hbqt/qtcore/hbqtcore.hbx
* contrib/hbqt/qtdesigner/hbqtdesigner.hbx
* contrib/hbqt/qtgui/hbqtgui.hbx
* contrib/hbqt/qtnetwork/hbqtnetwork.hbx
* contrib/hbqt/qtuitools/hbqtuitools.hbx
* contrib/hbqt/qtwebkit/hbqtwebkit.hbx
* contrib/hbqt/hbmk2_qt.hbs
+ Implemented: removed the need of any PRG wrapper to Q*Class() calls.
Shifted to C++ level.
NOTE: still corresponding blank .prg(s) are created inside .hbmk
folders. I could not follow the logic to remove them from build
process, Viktor ?
2011-03-10 22:38 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/compiler/hbmain.c
! fixed GPF when -build cor -credit parameters were used with

View File

@@ -1049,6 +1049,7 @@ CREATE CLASS HbQtSource
DATA code_ INIT {}
DATA cls_ INIT {}
DATA new_ INIT {}
DATA newW_ INIT {}
DATA old_ INIT {}
DATA enums_ INIT {}
DATA enum_ INIT {}
@@ -1078,6 +1079,7 @@ CREATE CLASS HbQtSource
METHOD parseVariables( cProto )
METHOD build()
METHOD getConstructor( nClsType )
METHOD getConstructorW()
METHOD buildCppCode( oMtd )
METHOD buildMethodBody( oMtd )
METHOD buildDOC()
@@ -1166,6 +1168,9 @@ METHOD HbQtSource:new( cQtModule, cQtVer, cQTHFileName, cCPPFileName, cPRGFileNa
NEXT
::code_ := ::old_
::newW_:= aClone( ::new_ )
::newW_[ 1 ] := "HB_FUNC( " + upper( ::cQtObject ) + " )"
/* Pullout constructor methods */
#if 0
tmp := ::cQtObject + " ("
@@ -1578,10 +1583,14 @@ METHOD HbQtSource:build()
aadd( aLine, "}" )
aadd( aLine, "" )
/* Build PRG level constructor */
aadd( aLine, ::newW_[ 1 ] ) // Func definition
aadd( aLine, ::newW_[ 2 ] ) // {
aeval( ::getConstructorW(), {|e| aadd( aLine, e ) } )
/* Build the constructor */
aadd( aLine, ::new_[ 1 ] ) // Func definition
aadd( aLine, ::new_[ 2 ] ) // {
aeval( ::getConstructor( 0 ), {|e| aadd( aLine, e ) } )
/* Insert Functions */
@@ -1624,13 +1633,7 @@ METHOD HbQtSource:build()
METHOD HbQtSource:getConstructor( nClsType )
LOCAL i, s, aLine := {}
IF nClsType == 1
aadd( aLine, " if( s_p" + ::cQtObject + " == NULL )" )
aadd( aLine, " hbqt_" + ::cQtObject + "Init();" )
aadd( aLine, " PHB_ITEM pObject = hbqt_" + ::cQtObject + "New();" )
aadd( aLine, "" )
ENDIF
HB_SYMBOL_UNUSED( nClsType )
IF ::isConstructor
IF ::isList
@@ -1655,19 +1658,12 @@ METHOD HbQtSource:getConstructor( nClsType )
ENDIF
NEXT
aadd( aLine, " " )
IF nClsType == 0
aadd( aLine, " hbqt_itemPushReturn( hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, " + iif( ::isDetached, "false", "true" ) + " ), hb_stackSelfItem() );" )
ELSE
aadd( aLine, " hb_arraySetPtrGC( pObject, 1, hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, true ) );" )
ENDIF
aadd( aLine, " hbqt_itemPushReturn( hbqt_gcAllocate_" + ::cQtObject + "( ( void * ) pObj, " + iif( ::isDetached, "false", "true" ) + " ), hb_stackSelfItem() );" )
ELSE
FOR i := 3 TO len( ::new_ ) - 1
aadd( aLine, ::new_[ i ] )
NEXT
ENDIF
IF nClsType == 1
aadd( aLine, " hb_itemReturnRelease( pObject );" )
ENDIF
aadd( aLine, ::new_[ len( ::new_ ) ] ) // }
aadd( aLine, "" )
@@ -1675,6 +1671,16 @@ METHOD HbQtSource:getConstructor( nClsType )
/*----------------------------------------------------------------------*/
METHOD HbQtSource:getConstructorW()
LOCAL aLine := ::getConstructor( 0 )
aeval( aLine, {|e,i| aLine[ i ] := strtran( e, "hbqt_itemPushReturn", "hbqt_create_objectGC" ) } )
aeval( aLine, {|e,i| aLine[ i ] := strtran( e, "hb_stackSelfItem()" , '"HB_' + upper( ::cQtObject ) + '"' ) } )
RETURN aLine
/*----------------------------------------------------------------------*/
METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType )
LOCAL FP, cTmp, n
LOCAL v, t_
@@ -1970,12 +1976,12 @@ METHOD HbQtSource:buildClass()
NEXT
txt_ := hbqtgen_BuildCopyrightText( 1 )
#if 0
aadd( txt_, "" )
aadd( txt_, "FUNCTION " + ::cQtObject + "( ... )" )
aadd( txt_, "FUNCTION x" + ::cQtObject + "( ... )" )
aadd( txt_, " RETURN HB_" + ::cQtObject + "():new( ... )" )
aadd( txt_, "" )
#endif
aadd( txt_, " " )
aadd( txt_, " " )
@@ -2009,7 +2015,7 @@ STATIC FUNCTION hbide_paramCheckStrCpp( cType, nArg, cCast )
SWITCH cType
CASE "PB"
// RETURN "( " + "hb_isBlock( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + " .OR. " + "hb_isPointer( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )"
// RETURN "( " + "hb_isBlock( hb_pvalue( " + hb_ntos( nArg ) + " ) )" + " .OR. " + "hb_isPointer( hb_pvalue( " + hb_ntos( nArg ) + " ) ) )"
RETURN "! HB_ISNIL( " + hb_ntos( nArg ) + " )"
CASE "P" //TODO
RETURN "HB_ISPOINTER( " + hb_ntos( nArg ) + " )"

View File

@@ -214,3 +214,12 @@ METHOD HbQtObjectHandler:disconnect( cnEvent )
RETURN .F.
/*----------------------------------------------------------------------*/
FUNCTION hbqt_promotWidget( oWidget, cWidgetTo )
LOCAL oObj := Eval( &( "{|| HB_" + cWidgetTo + "() }" ) )
oObj:pPtr := oWidget:pPtr
RETURN oObj
/*----------------------------------------------------------------------*/

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */
@@ -34,6 +32,7 @@ DYNAMIC HBQTOBJECTHANDLER
DYNAMIC HBQT_FINDCHILD
DYNAMIC HBQT_ISEQUAL
DYNAMIC HBQT_ISOBJECT
DYNAMIC HBQT_PROMOTWIDGET
DYNAMIC HB_HBQEVENTS
DYNAMIC HB_HBQSLOTS
DYNAMIC HB_HBQSTRING
@@ -154,6 +153,9 @@ DYNAMIC QTIME
DYNAMIC QTIMELINE
DYNAMIC QTIMER
DYNAMIC QTRANSLATOR
DYNAMIC QT_QURL_SETQUERYDELIMITERS
DYNAMIC QT_VERSION
DYNAMIC QT_VERSION_STR
DYNAMIC QURL
DYNAMIC QVARIANT
DYNAMIC QVERSION

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */
@@ -543,6 +541,8 @@ DYNAMIC QTRANSFORM
DYNAMIC QTREEVIEW
DYNAMIC QTREEWIDGET
DYNAMIC QTREEWIDGETITEM
DYNAMIC QT_QAPPLICATION_EXECUTE
DYNAMIC QT_QAPPLICATION_QUIT
DYNAMIC QVALIDATOR
DYNAMIC QVBOXLAYOUT
DYNAMIC QWHEELEVENT

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */
@@ -42,6 +40,8 @@ DYNAMIC QHTTPREQUESTHEADER
DYNAMIC QHTTPRESPONSEHEADER
DYNAMIC QNETWORKPROXY
DYNAMIC QNETWORKREQUEST
DYNAMIC QT_QFTP_READ
DYNAMIC QT_QHTTP_READ
DYNAMIC QURLINFO
DYNAMIC __HBQTNETWORK

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */

View File

@@ -3,14 +3,12 @@
*/
/* -------------------------------------------------------------------- */
/* NOTE: Following comments are control commands for the generator. */
/* Do not edit them unless you know what you are doing. */
/* NOTE: You can add manual override which functions to include or */
/* exclude from automatically generated EXTERNAL/DYNAMIC list. */
/* Syntax: // HB_FUNC_INCLUDE <func> */
/* // HB_FUNC_EXCLUDE <func> */
/* -------------------------------------------------------------------- */
// HB_FUNC_EXCLUDE QT_*
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated code below. DO NOT EDIT! */
/* Regenerate using hbmk2 '-hbx=' option. */