* contrib/hbide/hbide.prg

* contrib/hbide/ideactions.prg
  * contrib/hbide/idedocks.prg
  * contrib/hbide/ideeditor.prg
  * contrib/hbide/idefindreplace.prg
  * contrib/hbide/idemisc.prg
  * contrib/hbide/ideprojmanager.prg
  * contrib/hbide/idethemes.prg

  * contrib/hbqt/filelist.mk
  * contrib/hbqt/generator/qt45.qtp
  * contrib/hbqt/hbqt.h
  * contrib/hbqt/qtcore/filelist.mk
  + contrib/hbqt/qtcore/QBuffer.cpp
  + contrib/hbqt/qtcore/TQBuffer.prg
  + contrib/hbqt/qth/QBuffer.qth
  - contrib/hbqt/THbpQtUI.prg
  + contrib/hbqt/THbQtUI.prg

  * contrib/hbxbp/hbpprocess.prg
  * contrib/hbxbp/xbpfontdialog.prg
  * contrib/hbxbp/xbpgeneric.prg
  * contrib/hbxbp/xbphtmlviewer.prg
  * contrib/hbxbp/xbplistbox.prg
  * contrib/hbxbp/xbpmenubar.prg
  * contrib/hbxbp/xbpprintdialog.prg
  * contrib/hbxbp/xbpstatusbar.prg
  * contrib/hbxbp/xbptoolbar.prg
  * contrib/hbxbp/xbptreeview.prg
  * contrib/hbxbp/xbpwindow.prg

    -+ HbpQtUI => HbQtUI.
    !  Cleaned :pPtr := 0  =>  :pPtr := NIL
    +  Implemented QBuffer() class which allows to load .u
       from .prg embedding or from database.
This commit is contained in:
Pritpal Bedi
2010-01-29 17:27:16 +00:00
parent bb2d4cd82f
commit 0cb619640d
28 changed files with 512 additions and 55 deletions

View File

@@ -17,6 +17,43 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-29 09:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idefindreplace.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/idethemes.prg
* contrib/hbqt/filelist.mk
* contrib/hbqt/generator/qt45.qtp
* contrib/hbqt/hbqt.h
* contrib/hbqt/qtcore/filelist.mk
+ contrib/hbqt/qtcore/QBuffer.cpp
+ contrib/hbqt/qtcore/TQBuffer.prg
+ contrib/hbqt/qth/QBuffer.qth
- contrib/hbqt/THbpQtUI.prg
+ contrib/hbqt/THbQtUI.prg
* contrib/hbxbp/hbpprocess.prg
* contrib/hbxbp/xbpfontdialog.prg
* contrib/hbxbp/xbpgeneric.prg
* contrib/hbxbp/xbphtmlviewer.prg
* contrib/hbxbp/xbplistbox.prg
* contrib/hbxbp/xbpmenubar.prg
* contrib/hbxbp/xbpprintdialog.prg
* contrib/hbxbp/xbpstatusbar.prg
* contrib/hbxbp/xbptoolbar.prg
* contrib/hbxbp/xbptreeview.prg
* contrib/hbxbp/xbpwindow.prg
-+ HbpQtUI => HbQtUI.
! Cleaned :pPtr := 0 => :pPtr := NIL
+ Implemented QBuffer() class which allows to load .u
from .prg embedding or from database.
2010-01-29 13:09 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rdd/dbfcdx/dbfcdx1.c
! fixed possible unreleased lock after last modification in SIXCDX -

View File

@@ -417,7 +417,7 @@ METHOD HbIde:create( cProjIni )
hbide_dbg( "After ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() )
hbide_dbg( "======================================================" )
::qCursor:pPtr := 0
::qCursor:pPtr := NIL
::oFont := NIL
hbide_dbg( "EXITING after destroy ....", memory( 1001 ), hbqt_getMemUsed() )

View File

@@ -117,7 +117,7 @@ METHOD IdeActions:destroy()
LOCAL qAction
FOR EACH qAction IN ::hActions
qAction:pPtr := 0
qAction:pPtr := NIL
NEXT
RETURN Self

View File

@@ -130,7 +130,7 @@ METHOD IdeDocks:buildDialog()
::oIde:oDlg := XbpDialog():new()
::oDlg:icon := ::resPath + "vr.png" // "hbide.png"
::oDlg:title := "Harbour-Qt IDE"
::oDlg:qtObject := HbpQtUI():new( ::resPath + "mainWindow.ui" )
::oDlg:qtObject := HbQtUI():new( ::resPath + "mainWindow.ui" )
::oDlg:create( , , , , , .f. )
#else
::oIde:oDlg := XbpDialog():new( , , {10,10}, {1100,700}, , .f. )

View File

@@ -837,7 +837,7 @@ METHOD IdeEditsManager:goto()
nLine := qGo:intValue() - nLine
qGo:pPtr := 0
qGo:pPtr := NIL
IF nLine < 0
qCursor:movePosition( QTextCursor_Up, QTextCursor_MoveAnchor, abs( nLine ) + 1 )
@@ -1102,20 +1102,20 @@ hbide_dbg( "IdeEditor:destroy()", 0 )
::oEdit:destroy()
IF !Empty( ::qDocument )
::qDocument:pPtr := 0
::qDocument := nil
::qDocument:pPtr := NIL
::qDocument := NIL
ENDIF
IF !Empty( ::qHiliter )
::qHiliter:pPtr := 0
::qHiliter := nil
::qHiliter:pPtr := NIL
::qHiliter := NIL
ENDIF
::oEdit := NIL
IF !Empty( ::qLayout )
::qLayout:pPtr := 0
::qLayout := nil
::qLayout:pPtr := NIL
::qLayout := NIL
ENDIF
IF ( n := ascan( ::aTabs, {|e_| e_[ TAB_OEDITOR ] == Self } ) ) > 0

View File

@@ -110,7 +110,7 @@ METHOD IdeFindReplace:create( oIde )
::oIde := oIde
::oUI := HbpQtUI():new( ::oIde:resPath + "finddialog.ui", ::oIde:oDlg:oWidget )
::oUI := HbQtUI():new( ::oIde:resPath + "finddialog.ui", ::oIde:oDlg:oWidget )
::oUI:setWindowFlags( Qt_Sheet )
aeval( ::oIde:aIni[ INI_FIND ], {|e| ::oUI:q_comboFindWhat:addItem( e ) } )
@@ -130,6 +130,7 @@ METHOD IdeFindReplace:create( oIde )
::oUI:signal( "checkListOnly", "stateChanged(int)", {|o,p| o := o, ;
::oUI:q_comboReplaceWith:setEnabled( p == 0 ), ;
iif( p == 1, ::oUI:q_buttonReplace:setEnabled( .f. ), NIL ) } )
RETURN Self
/*----------------------------------------------------------------------*/
@@ -144,12 +145,12 @@ METHOD IdeFindReplace:show()
::oIde:setPosByIni( ::oUI:oWidget, FindDialogGeometry )
::oUI:q_comboFindWhat:setFocus()
qLineEdit := QLineEdit():configure( ::oUI:q_comboFindWhat:lineEdit() )
IF !empty( cText := ::oEM:getSelectedText() )
qLineEdit := QLineEdit():configure( ::oUI:q_comboFindWhat:lineEdit() )
qLineEdit:setText( cText )
qLineEdit:selectAll()
//QLineEdit( ::oUI:q_comboFindWhat:lineEdit() ):setText( cText ):selectAll()
ENDIF
qLineEdit:selectAll()
::oUI:show()
RETURN Self
@@ -248,6 +249,8 @@ METHOD IdeFindReplace:onClickFind()
::oUI:q_buttonReplace:setEnabled( .f. )
::oUI:q_checkGlobal:setEnabled( .f. )
::oUI:q_checkNoPrompting:setEnabled( .f. )
::oUI:q_buttonFind:setFocus_1()
ENDIF
RETURN Self
@@ -332,7 +335,7 @@ METHOD IdeFindInFiles:create( oIde )
::oIde := oIde
::oUI := HbpQtUI():new( ::oIde:resPath + "findinfiles.ui", ::oIde:oDlg:oWidget )
::oUI := HbQtUI():new( ::oIde:resPath + "findinfiles.ui", ::oIde:oDlg:oWidget )
::oUI:setWindowFlags( Qt_Sheet )
::oUI:exec()

View File

@@ -148,7 +148,7 @@ FUNCTION hbide_execPopup( aPops, aPos, qParent )
NEXT
ENDIF
qPop:pPtr := 0
qPop:pPtr := NIL
RETURN xRet

View File

@@ -544,7 +544,7 @@ METHOD IdeProjManager:fetchProperties()
LOCAL cLukupPng
LOCAL cPrjLoc := hb_dirBase() + "projects"
::oUI := HbpQtUI():new( ::resPath + "projectproperties.ui", ::oDlg:oWidget )
::oUI := HbQtUI():new( ::resPath + "projectproperties.ui", ::oDlg:oWidget )
::oUI:q_tabWidget:removeTab( 4 )
@@ -953,7 +953,7 @@ METHOD IdeProjManager:loadXhpProject()
METHOD IdeProjManager:manageEnvironments()
LOCAL cLukupPng
::oUI := HbpQtUI():new( ::resPath + "projectproperties.ui", ::oDlg:oWidget )
::oUI := HbQtUI():new( ::resPath + "projectproperties.ui", ::oDlg:oWidget )
cLukupPng := ::resPath + "folder.png"
//
@@ -1255,7 +1255,7 @@ METHOD IdeProjManager:selectCurrentProject()
RETURN ::cWrkProject
ENDIF
oDlg := HbpQtUI():new( ::oIDE:resPath + "selectproject.ui", ::oDlg:oWidget )
oDlg := HbQtUI():new( ::oIDE:resPath + "selectproject.ui", ::oDlg:oWidget )
* Fill ComboBox with current project names
FOR i := 1 TO Len( ::aProjects )
@@ -1618,7 +1618,7 @@ METHOD IdeProjManager:launchProject( cProject )
qProcess:setWorkingDirectory( hbide_pathToOSPath( oProject:wrkDirectory ) )
qProcess:startDetached_2( cTargetFN )
qProcess:waitForStarted()
qProcess:pPtr := 0
qProcess:pPtr := NIL
qProcess := NIL
#else
::oProcess := HbpProcess():new()

View File

@@ -411,7 +411,7 @@ METHOD IdeThemes:fetch()
IF empty( ::oUI )
::lCreating := .t.
::oUI := HbpQtUI():new( ::oIde:resPath + "themes.ui", ::oIde:oDlg:oWidget )
::oUI := HbQtUI():new( ::oIde:resPath + "themes.ui", ::oIde:oDlg:oWidget )
::oUI:setWindowFlags( Qt_Sheet )
::oUI:signal( "comboThemes" , "currentIndexChanged(int)", {|o,i| ::nCurTheme := i+1, ::setTheme( i,o ) } )
@@ -586,7 +586,7 @@ METHOD IdeThemes:selectTheme()
LOCAL oSL, oStrList, oStrModel, a_, nDone
LOCAL pSlots := Qt_Slots_New()
oSL := HbpQtUI():new( ::oIde:resPath + "selectionlist.ui", ::oIde:oDlg:oWidget )
oSL := HbQtUI():new( ::oIde:resPath + "selectionlist.ui", ::oIde:oDlg:oWidget )
oSL:setWindowTitle( "Available Themes" )
oStrList := QStringList():new()

View File

@@ -56,7 +56,7 @@
* EkOnkar
* ( The LORD is ONE )
*
* Harbour Parts HbpQtUI Class
* Harbour Parts HbQtUI Class
*
* Pritpal Bedi <pritpal@vouchcac.com>
* 28Jan2010
@@ -70,7 +70,7 @@
/*----------------------------------------------------------------------*/
CLASS HbpQtUI
CLASS HbQtUI
DATA pSlots
DATA oWidget
@@ -95,7 +95,7 @@ CLASS HbpQtUI
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:new( cFile, qParent )
METHOD HbQtUI:new( cFile, qParent )
IF !empty( cFile ) .and. file( cFile )
hb_hCaseMatch( ::qObj, .f. )
@@ -113,7 +113,7 @@ METHOD HbpQtUI:new( cFile, qParent )
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:destroy()
METHOD HbQtUI:destroy()
LOCAL a_, qObj
::oWidget:hide()
@@ -126,13 +126,12 @@ METHOD HbpQtUI:destroy()
NEXT
FOR EACH qObj IN ::qObj
qObj:pPtr := 0
qObj:pPtr := NIL
NEXT
::oWidget:close()
::oWidget:pPtr := 0
::oWidget:pPtr := NIL
::oWidget := NIL
::aEvents := NIL
::aSignals := NIL
@@ -141,7 +140,7 @@ METHOD HbpQtUI:destroy()
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:event( cWidget, nEvent, bBlock )
METHOD HbQtUI:event( cWidget, nEvent, bBlock )
IF hb_hHasKey( ::qObj, cWidget )
IF Qt_Events_Connect( ::pEvents, ::qObj[ cWidget ], nEvent, bBlock )
@@ -153,7 +152,7 @@ METHOD HbpQtUI:event( cWidget, nEvent, bBlock )
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:signal( cWidget, cSignal, bBlock )
METHOD HbQtUI:signal( cWidget, cSignal, bBlock )
IF hb_hHasKey( ::qObj, cWidget )
IF empty( ::pSlots )
@@ -168,7 +167,7 @@ METHOD HbpQtUI:signal( cWidget, cSignal, bBlock )
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:loadWidgets()
METHOD HbQtUI:loadWidgets()
LOCAL a_, pPtr, bBlock, x, cBlock
FOR EACH a_ IN ::widgets
@@ -192,7 +191,7 @@ METHOD HbpQtUI:loadWidgets()
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:loadContents( cUiFull )
METHOD HbQtUI:loadContents( cUiFull )
LOCAL cBuffer := memoread( cUiFull )
LOCAL n, cClass, cWidget
@@ -217,10 +216,20 @@ METHOD HbpQtUI:loadContents( cUiFull )
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:loadUI( cUiFull, qParent )
METHOD HbQtUI:loadUI( cUiFull, qParent )
LOCAL oWidget, qUiLoader, qFile, pWidget
#if 1
LOCAL cBuffer
/* This method allows to use ui components stored in a
* database or embedded into sources as a text file stream
*/
cBuffer := hb_memoRead( cUiFull )
qFile := QBuffer():new()
qFile:setData( cBuffer, len( cBuffer ) )
#else
qFile := QFile():new( cUiFull )
#endif
IF qFile:open( 1 )
qUiLoader := QUiLoader():new()
pWidget := qUiLoader:load( qFile, qParent )
@@ -243,7 +252,7 @@ METHOD HbpQtUI:loadUI( cUiFull, qParent )
/*----------------------------------------------------------------------*/
METHOD HbpQtUI:OnError( ... )
METHOD HbQtUI:OnError( ... )
LOCAL cMsg, xReturn
cMsg := __GetMessage()

View File

@@ -26,7 +26,7 @@ CPP_SOURCES := \
PRG_SOURCES := \
hbqt_misc.prg \
hbqt_errorsys.prg \
THbpQtUI.prg \
THbQtUI.prg \
# Don't delete this comment, it's here to ensure empty
# line above is kept intact.

View File

@@ -41,6 +41,7 @@ QBitArray.qth
QBitmap.qth
QBoxLayout.qth
QBrush.qth
QBuffer.qth
QButtonGroup.qth
QByteArray.qth
QCalendarWidget.qth

View File

@@ -111,6 +111,7 @@ extern void * hbqt_pPtrFromItem( PHB_ITEM pObj );
#define hbqt_par_QBitmap( n ) ( ( QBitmap * ) hbqt_gcpointer( n ) )
#define hbqt_par_QBoxLayout( n ) ( ( QBoxLayout * ) hbqt_gcpointer( n ) )
#define hbqt_par_QBrush( n ) ( ( QBrush * ) hbqt_gcpointer( n ) )
#define hbqt_par_QBuffer( n ) ( ( QBuffer * ) hbqt_gcpointer( n ) )
#define hbqt_par_QButtonGroup( n ) ( ( QButtonGroup * ) hbqt_gcpointer( n ) )
#define hbqt_par_QByteArray( n ) ( ( QByteArray * ) hbqt_gcpointer( n ) )
#define hbqt_par_QCalendarWidget( n ) ( ( QCalendarWidget * ) hbqt_gcpointer( n ) )

View File

@@ -0,0 +1,196 @@
/*
* $Id$
*/
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated source file. DO NOT EDIT! */
/* Instead, edit corresponding .qth file, */
/* or the generator tool itself, and run regenarate. */
/* -------------------------------------------------------------------- */
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
#include "hbapi.h"
#include "../hbqt.h"
/*----------------------------------------------------------------------*/
#if QT_VERSION >= 0x040500
/*----------------------------------------------------------------------*/
#include <QtCore/QPointer>
#include <QtCore/QBuffer>
/*
* QBuffer ( QObject * parent = 0 )
* QBuffer ( QByteArray * byteArray, QObject * parent = 0 )
* ~QBuffer ()
*/
typedef struct
{
void * ph;
bool bNew;
QT_G_FUNC_PTR func;
QPointer< QBuffer > pq;
} QGC_POINTER_QBuffer;
QT_G_FUNC( hbqt_gcRelease_QBuffer )
{
QGC_POINTER_QBuffer * p = ( QGC_POINTER_QBuffer * ) Cargo;
if( p && p->bNew )
{
if( p->ph && p->pq )
{
const QMetaObject * m = ( ( QObject * ) p->ph )->metaObject();
if( ( QString ) m->className() != ( QString ) "QObject" )
{
delete ( ( QBuffer * ) p->ph );
HB_TRACE( HB_TR_DEBUG, ( "YES_rel_QBuffer ph=%p pq=%p %i B %i KB", p->ph, (void *)(p->pq), ( int ) hb_xquery( 1001 ), hbqt_getmemused() ) );
p->ph = NULL;
}
else
{
HB_TRACE( HB_TR_DEBUG, ( "NO__rel_QBuffer ph=%p pq=%p %i B %i KB", p->ph, (void *)(p->pq), ( int ) hb_xquery( 1001 ), hbqt_getmemused() ) );
}
}
else
{
HB_TRACE( HB_TR_DEBUG, ( "DEL_rel_QBuffer Object already deleted!" ) );
}
}
else
{
HB_TRACE( HB_TR_DEBUG, ( "PTR_rel_QBuffer Object not created with - new" ) );
p->ph = NULL;
}
}
void * hbqt_gcAllocate_QBuffer( void * pObj, bool bNew )
{
QGC_POINTER_QBuffer * p = ( QGC_POINTER_QBuffer * ) hb_gcAllocate( sizeof( QGC_POINTER_QBuffer ), hbqt_gcFuncs() );
p->ph = pObj;
p->bNew = bNew;
p->func = hbqt_gcRelease_QBuffer;
if( bNew )
{
new( & p->pq ) QPointer< QBuffer >( ( QBuffer * ) pObj );
HB_TRACE( HB_TR_DEBUG, ( " _new_QBuffer ph=%p %i B %i KB", pObj, ( int ) hb_xquery( 1001 ), hbqt_getmemused() ) );
}
return p;
}
HB_FUNC( QT_QBUFFER )
{
void * pObj = NULL;
pObj = new QBuffer() ;
hb_retptrGC( hbqt_gcAllocate_QBuffer( pObj, true ) );
}
/*
* QByteArray & buffer ()
*/
HB_FUNC( QT_QBUFFER_BUFFER )
{
hb_retptrGC( hbqt_gcAllocate_QByteArray( new QByteArray( hbqt_par_QBuffer( 1 )->buffer() ), true ) );
}
/*
* const QByteArray & buffer () const
*/
HB_FUNC( QT_QBUFFER_BUFFER_1 )
{
hb_retptrGC( hbqt_gcAllocate_QByteArray( new QByteArray( hbqt_par_QBuffer( 1 )->buffer() ), true ) );
}
/*
* const QByteArray & data () const
*/
HB_FUNC( QT_QBUFFER_DATA )
{
hb_retptrGC( hbqt_gcAllocate_QByteArray( new QByteArray( hbqt_par_QBuffer( 1 )->data() ), true ) );
}
/*
* void setBuffer ( QByteArray * byteArray )
*/
HB_FUNC( QT_QBUFFER_SETBUFFER )
{
hbqt_par_QBuffer( 1 )->setBuffer( hbqt_par_QByteArray( 2 ) );
}
/*
* void setData ( const char * data, int size )
*/
HB_FUNC( QT_QBUFFER_SETDATA )
{
hbqt_par_QBuffer( 1 )->setData( hbqt_par_char( 2 ), hb_parni( 3 ) );
}
/*
* void setData ( const QByteArray & data )
*/
HB_FUNC( QT_QBUFFER_SETDATA_1 )
{
hbqt_par_QBuffer( 1 )->setData( *hbqt_par_QByteArray( 2 ) );
}
/*----------------------------------------------------------------------*/
#endif /* #if QT_VERSION >= 0x040500 */
/*----------------------------------------------------------------------*/

View File

@@ -0,0 +1,111 @@
/*
* $Id$
*/
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated source file. DO NOT EDIT! */
/* Instead, edit corresponding .qth file, */
/* or the generator tool itself, and run regenarate. */
/* -------------------------------------------------------------------- */
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009-2010 Pritpal Bedi <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
#include "hbclass.ch"
CREATE CLASS QBuffer INHERIT HbQtObjectHandler, QIODevice
METHOD new( ... )
METHOD buffer()
METHOD buffer_1()
METHOD data()
METHOD setBuffer( pByteArray )
METHOD setData( pData, nSize )
METHOD setData_1( pData )
ENDCLASS
METHOD QBuffer:new( ... )
LOCAL p
FOR EACH p IN { ... }
hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) )
NEXT
::pPtr := Qt_QBuffer( ... )
RETURN Self
METHOD QBuffer:buffer()
RETURN Qt_QBuffer_buffer( ::pPtr )
METHOD QBuffer:buffer_1()
RETURN Qt_QBuffer_buffer_1( ::pPtr )
METHOD QBuffer:data()
RETURN Qt_QBuffer_data( ::pPtr )
METHOD QBuffer:setBuffer( pByteArray )
RETURN Qt_QBuffer_setBuffer( ::pPtr, hbqt_ptr( pByteArray ) )
METHOD QBuffer:setData( pData, nSize )
RETURN Qt_QBuffer_setData( ::pPtr, hbqt_ptr( pData ), nSize )
METHOD QBuffer:setData_1( pData )
RETURN Qt_QBuffer_setData_1( ::pPtr, hbqt_ptr( pData ) )

View File

@@ -16,6 +16,7 @@ CPP_SOURCES := \
QAbstractListModel.cpp \
QAbstractTableModel.cpp \
QBitArray.cpp \
QBuffer.cpp \
QByteArray.cpp \
QChar.cpp \
QCoreApplication.cpp \
@@ -72,6 +73,7 @@ PRG_SOURCES := \
TQAbstractListModel.prg \
TQAbstractTableModel.prg \
TQBitArray.prg \
TQBuffer.prg \
TQByteArray.prg \
TQChar.prg \
TQCoreApplication.prg \

View File

@@ -0,0 +1,101 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT Source Generator for Harbour
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
;
; Header File to Generate QT Wrapper Sources
;
<CLASS>
QObject =
Inherits = QIODevice
Type =
New =
</CLASS>
<SUBCLASS>
</SUBCLASS>
<DOC>
</DOC>
<CODE>
#include <QtCore/QBuffer>
/*
* QBuffer ( QObject * parent = 0 )
* QBuffer ( QByteArray * byteArray, QObject * parent = 0 )
* ~QBuffer ()
*/
HB_FUNC( QT_QBUFFER )
{
hb_retptr( new QBuffer() );
}
</CODE>
<ENUMS>
</ENUMS>
<PROTOS>
QByteArray & buffer ()
const QByteArray & buffer () const
const QByteArray & data () const
void setBuffer ( QByteArray * byteArray )
void setData ( const char * data, int size )
void setData ( const QByteArray & data )
</PROTOS>
<SLOTS>
</SLOTS>
<SIGNALS>
</SIGNALS>

View File

@@ -291,7 +291,7 @@ METHOD HbpProcess:finish()
::qProcess:kill()
//
::qProcess:pPtr := 0
::qProcess:pPtr := NIL
::qProcess := NIL
RETURN Self

View File

@@ -461,7 +461,7 @@ METHOD XbpFont:configure( cFontName )
METHOD XbpFont:destroy()
::oFontInfo:pPtr := 0
::oFontInfo:pPtr := NIL
::oWidget:pPtr := 0
RETURN NIL

View File

@@ -112,7 +112,7 @@ EXIT PROCEDURE hbxbp_End()
t_oAppWindow := NIL
IF hb_isObject( s_oDeskTop )
s_oDeskTop:oWidget:pPtr := 0
s_oDeskTop:oWidget:pPtr := NIL
endif
/* These must never be called from here as QApplication.cpp's EXIT routine does it */

View File

@@ -187,7 +187,7 @@ METHOD XbpHTMLViewer:destroy()
::oWidget:stop()
::disconnect()
IF !empty( ::oURL )
::oURL:pPtr := 0
::oURL:pPtr := NIL
::oURL := NIL
ENDIF
::sl_beforeNavigate := NIL

View File

@@ -259,8 +259,8 @@ METHOD XbpListBox:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
METHOD XbpListBox:destroy()
::disconnect()
::oStrList:pPtr := 0
::oStrModel:pPtr := 0
::oStrList:pPtr := NIL
::oStrModel:pPtr := NIL
::oStrList := NIL
::oStrModel := NIL

View File

@@ -267,7 +267,7 @@ METHOD xbpMenuBar:delItem( nItemIndex )
Qt_Slots_disConnect( ::pSlots, oAction, "hovered()" )
ENDIF
::oWidget:removeAction( oAction )
oAction:pPtr := 0
oAction:pPtr := NIL
oAction := NIL
ENDIF
ENDIF

View File

@@ -125,7 +125,7 @@ METHOD XbpPrintDialog:destroy()
::aConnections := {}
ENDIF
::oWidget:pPtr := 0
::oWidget:pPtr := NIL
::oWidget := NIL
RETURN nil

View File

@@ -173,7 +173,7 @@ METHOD XbpStatusBar:destroy()
IF ( nItems := Len( ::aItems ) ) > 0
FOR i := 1 TO nItems
::aItems[ i ]:oParent := NIL
::aItems[ i ]:oWidget:pPtr := 0
::aItems[ i ]:oWidget:pPtr := NIL
NEXT
ENDIF

View File

@@ -220,7 +220,7 @@ METHOD XbpToolbar:destroy()
ENDIF
IF ::aItems[ i,3 ] == XBPTOOLBAR_BUTTON_DEFAULT
::aItems[ i,2 ]:oAction:pPtr := 0
::aItems[ i,2 ]:oAction:pPtr := NIL
::aItems[ i,2 ]:oAction := NIL
ENDIF
NEXT

View File

@@ -267,7 +267,7 @@ METHOD XbpTreeView:destroy()
FOR i := len( ::aItems ) TO 1 step -1
aeval( ::aItems[ i ]:aChilds, {|e,j| e := e, ::aItems[ i ]:aChilds[ j ] := NIL } )
::aItems[ i ]:oWidget:pPtr := 0
::aItems[ i ]:oWidget:pPtr := NIL
NEXT
::aItems := NIL
@@ -453,12 +453,10 @@ METHOD XbpTreeViewItem:destroy()
LOCAL i
FOR i := 1 TO len( ::aChilds )
::aChilds[ i ]:pPtr := 0
::aChilds[ i ]:pPtr := NIL
NEXT
::oItem:pPtr := 0
::oItem:pPtr := Nil
::oItem:pPtr := NIL
RETURN NIL
@@ -493,7 +491,7 @@ METHOD XbpTreeViewItem:delItem( oItem )
IF ( n := ascan( ::aChilds, {|o| o == oItem } ) ) > 0
::oWidget:removeChild( ::aChilds[ n ]:oWidget:pPtr )
::aChilds[ n ]:oWidget:pPtr := 0
::aChilds[ n ]:oWidget:pPtr := NIL
adel( ::aChilds, n )
asize( ::aChilds, len( ::aChilds )-1 )
ENDIF

View File

@@ -466,7 +466,7 @@ METHOD XbpWindow:destroy()
IF cXbp == "XBPDIALOG"
hbxbp_SetEventLoop( NIL )
::oEventLoop:exit( 0 )
::oEventLoop:pPtr := 0
::oEventLoop:pPtr := NIL
//SetAppWindow( XbpObject():new() ) /* Can play havoc on */
::oMenu := NIL
ENDIF
@@ -493,7 +493,7 @@ METHOD XbpWindow:destroy()
::qtObject:destroy()
::qtObject := NIL
ENDIF
::oWidget:pPtr := 0
::oWidget:pPtr := NIL
::oWidget := NIL
//HBXBP_DBG( hb_threadId()," Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
@@ -1233,9 +1233,7 @@ METHOD XbpWindow:isDerivedFrom( cClassORoObject )
/* Compares without Xbp or Wvg prefixes */
IF hb_isChar( cClassORoObject )
IF upper( substr( cClassORoObject,4 ) ) == upper( substr( cCls,4 ) )
lTrue := .t.
ENDIF
RETURN __clsParent( Self:classH, cClassORoObject )
ELSEIF hb_isObject( cClassORoObject )
IF upper( substr( cClassORoObject:className,4 ) ) == upper( substr( cCls,4 ) )