From 9444ab8a3a8e1424970c42db3b358c38fcbe99fb Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 18 Mar 2011 19:40:16 +0000 Subject: [PATCH] 2011-03-18 12:28 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqt_init.cpp * contrib/hbqt/qtcore/qth/filelist.hbm + contrib/hbqt/qtcore/qth/QChildEvent.qth * contrib/hbqt/qtgui/hbqt_init.cpp * contrib/hbqt/qtgui/hbqtgui.hbx * contrib/hbqt/qtgui/qth/filelist.hbm + contrib/hbqt/qtgui/qth/QActionEvent.qth + contrib/hbqt/qtgui/qth/QFileOpenEvent.qth + contrib/hbqt/qtgui/qth/QHoverEvent.qth * contrib/hbqt/qtgui/qth/QMoveEvent.qth * contrib/hbqt/qtgui/qth/QPaintEvent.qth + contrib/hbqt/qtgui/qth/QShortcutEvent.qth + Added: more events specific classes. * contrib/hbqt/hbmk2_qt.hbs ! Rationalized code fragments. - Deleted: meta object checking as it is now handelled by the generator. * contrib/hbqt/qtcore/hbqt_hbqevents.cpp ! Rationalized: catching the event. NOTE: hb_itemNew() should not be called here. The function returns a hb_stackReturnItem(). Object is already contained in .prg variable in user application and will be auto destructed when out of scope. --- harbour/ChangeLog | 26 +++++ harbour/contrib/hbqt/hbmk2_qt.hbs | 34 ++++-- .../contrib/hbqt/qtcore/hbqt_hbqevents.cpp | 58 +++++----- harbour/contrib/hbqt/qtcore/hbqt_init.cpp | 2 - .../contrib/hbqt/qtcore/qth/QChildEvent.qth | 100 +++++++++++++++++ harbour/contrib/hbqt/qtcore/qth/filelist.hbm | 1 + harbour/contrib/hbqt/qtgui/hbqt_init.cpp | 36 ++++-- harbour/contrib/hbqt/qtgui/hbqtgui.hbx | 8 ++ .../contrib/hbqt/qtgui/qth/QActionEvent.qth | 98 +++++++++++++++++ .../contrib/hbqt/qtgui/qth/QFileOpenEvent.qth | 104 ++++++++++++++++++ .../contrib/hbqt/qtgui/qth/QHoverEvent.qth | 98 +++++++++++++++++ harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth | 4 +- .../contrib/hbqt/qtgui/qth/QPaintEvent.qth | 8 +- .../contrib/hbqt/qtgui/qth/QShortcutEvent.qth | 100 +++++++++++++++++ harbour/contrib/hbqt/qtgui/qth/filelist.hbm | 4 + 15 files changed, 625 insertions(+), 56 deletions(-) create mode 100644 harbour/contrib/hbqt/qtcore/qth/QChildEvent.qth create mode 100644 harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth create mode 100644 harbour/contrib/hbqt/qtgui/qth/QFileOpenEvent.qth create mode 100644 harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth create mode 100644 harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5c02197027..5917ad30cb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,32 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-18 12:28 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtcore/hbqt_init.cpp + * contrib/hbqt/qtcore/qth/filelist.hbm + + contrib/hbqt/qtcore/qth/QChildEvent.qth + * contrib/hbqt/qtgui/hbqt_init.cpp + * contrib/hbqt/qtgui/hbqtgui.hbx + * contrib/hbqt/qtgui/qth/filelist.hbm + + contrib/hbqt/qtgui/qth/QActionEvent.qth + + contrib/hbqt/qtgui/qth/QFileOpenEvent.qth + + contrib/hbqt/qtgui/qth/QHoverEvent.qth + * contrib/hbqt/qtgui/qth/QMoveEvent.qth + * contrib/hbqt/qtgui/qth/QPaintEvent.qth + + contrib/hbqt/qtgui/qth/QShortcutEvent.qth + + Added: more events specific classes. + + * contrib/hbqt/hbmk2_qt.hbs + ! Rationalized code fragments. + - Deleted: meta object checking as it is now handelled by the generator. + + * contrib/hbqt/qtcore/hbqt_hbqevents.cpp + ! Rationalized: catching the event. + NOTE: hb_itemNew() should not be called here. The function + returns a hb_stackReturnItem(). Object is already contained + in .prg variable in user application and will be auto + destructed when out of scope. + 2011-03-18 13:37 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtgui/qth/QDesktopServices.qth * Patch [Francesco Perillo] diff --git a/harbour/contrib/hbqt/hbmk2_qt.hbs b/harbour/contrib/hbqt/hbmk2_qt.hbs index 39408070de..2a67c9b11a 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_qt.hbs @@ -1451,37 +1451,40 @@ METHOD HbQtSource:build() aadd( aLine, " " ) aadd( aLine, " if( p )" ) aadd( aLine, " {" ) - aadd( aLine, " if( p->bNew && p->ph )" ) + aadd( aLine, " if( p->bNew )" ) aadd( aLine, " {" ) - aadd( aLine, " " + ::cQtObject + " " + iif( ::isList, "< void * >", "" ) + "* ph = p->ph;" ) - aadd( aLine, " const QMetaObject * m = ( ph )->metaObject();" ) - aadd( aLine, ' if( ( QString ) m->className() != ( QString ) "QObject" )' ) - #ifdef _GEN_TRACE_ + aadd( aLine, " if( p->ph )" ) aadd( aLine, " {" ) + #ifdef _GEN_TRACE_ aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p %p YES_rel_' + ::cQtObject + ' /.\\ ", ( void * ) p, ( void * ) p->ph ) );' ) #endif - aadd( aLine, " delete ( p->ph ); " ) + aadd( aLine, " delete ( " + ::cQtObject + " * )( p->ph ); " ) #ifdef _GEN_TRACE_ aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p %p YES_rel_' + ::cQtObject + ' \\./ ", ( void * ) p, ( void * ) p->ph ) );' ) + #endif aadd( aLine, " }" ) + #ifdef _GEN_TRACE_ aadd( aLine, " else" ) aadd( aLine, " {" ) - aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p NO__rel_' + ::cQtObject + ' ", ( void * ) p->ph ) );') + aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p DEL_rel_' + ::cQtObject + ' : Object already deleted!", ( void * ) p->ph ) );' ) aadd( aLine, " }" ) #endif aadd( aLine, " }" ) #ifdef _GEN_TRACE_ aadd( aLine, " else" ) aadd( aLine, " {" ) - aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p DEL_rel_' + ::cQtObject + ' : Object already deleted!", ( void * ) p->ph ) );' ) + aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p PTR_rel_' + ::cQtObject + ' : Object not created with new=true", ( void * ) p->ph ) );' ) aadd( aLine, " }" ) #endif + aadd( aLine, " p->ph = NULL;" ) + aadd( aLine, " p = NULL;" ) aadd( aLine, " }" ) + #ifdef _GEN_TRACE_ aadd( aLine, " else" ) aadd( aLine, " {" ) - aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "ph=%p PTR_rel_' + ::cQtObject + ' : Object not created with new=true", ( void * ) p->ph ) );' ) + aadd( aLine, ' HB_TRACE( ' + ::cTrMode + ', ( "DEL_rel_' + ::cQtObject + ' : not valid" ) );' ) aadd( aLine, " }" ) #endif ELSE @@ -1724,7 +1727,8 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType ) aadd( txt_, "HB_FUNC_STATIC( " + upper( oMtd:cHBFunc ) + " )" ) aadd( txt_, "{" ) - aadd( txt_, ' HB_TRACE( HB_TR_DEBUG, ( "' + ::cQtObject+":"+oMtd:cHBFunc + '" ));' ) +// aadd( txt_, ' HB_TRACE( ' + ::cTrMode + ', ( "' + ::cQtObject + ":" + oMtd:cHBFunc + '" ) );' ) + aadd( txt_, ' HB_TRACE( HB_TR_DEBUG, ( "' + ::cQtObject + ":" + oMtd:cHBFunc + '" ) );' ) IF !empty( oMtd:fBody_ ) aeval( oMtd:fBody_, {|e| aadd( txt_, e ) } ) @@ -1756,6 +1760,9 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType ) aadd( txt_, " if( " + v + " )" ) aadd( txt_, " {" ) aadd( txt_, " " + FP + ";" ) + IF oMtd:oRet:cCast == "void" + aadd( txt_, " hb_itemReturn( hb_stackSelfItem() );" ) + ENDIF aadd( txt_, " }" ) ENDIF ELSE @@ -1773,6 +1780,9 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType ) aadd( txt_, " " + iif( i > 1 , "else if", "if" ) + "( pcount == 0 )" ) aadd( txt_, " {" ) aadd( txt_, " " + FP + ";" ) + IF oMtd:oRet:cCast == "void" + aadd( txt_, " hb_itemReturn( hb_stackSelfItem() );" ) + ENDIF aadd( txt_, " }" ) OTHERWISE @@ -1829,6 +1839,10 @@ METHOD HbQtSource:getMethodBody( oMtd, cMtdName, aMethods, nClsType ) NEXT ENDIF + IF oMtd:oRet:cCast == "void" + aadd( txt_, " hb_itemReturn( hb_stackSelfItem() );" ) + ENDIF + aadd( txt_, " }" ) ENDCASE NEXT diff --git a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp index c2ab8a8b65..2cd99a88bd 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp @@ -194,40 +194,42 @@ bool HBQEvents::hbClear() return true; } +/* DONOT Reformat */ bool HBQEvents::eventFilter( QObject * object, QEvent * event ) { - QEvent::Type eventtype = event->type(); - - if( ( int ) eventtype == 0 ) - return false; - - char prop[ 20 ]; - hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", eventtype, "P" ); - - int found = object->property( prop ).toInt(); - if( found == 0 ) - return false; - - bool ret = true; - - if( found <= listBlock.size() ) + bool ret = false; + if( object ) { - int eventId = s_lstEvent.indexOf( eventtype ); - if( eventId > -1 && hb_vmRequestReenter() ) + QEvent::Type eventtype = event->type(); + if( ( int ) eventtype > 0 ) { - PHBQT_EVENT_FUNC pCallback = s_pEventAllocateCallback.at( eventId ); - if( pCallback ) + char prop[ 20 ]; + hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", eventtype, "P" ); + + int found = object->property( prop ).toInt(); + if( found > 0 ) { - PHB_ITEM pEvent = hb_itemNew( hbqt_create_objectGC( ( * pCallback )( event, false ), s_lstCreateObj.at( eventId ) ) ); - - ret = hb_itemGetL( hb_vmEvalBlockV( ( PHB_ITEM ) listBlock.at( found - 1 ), 1, pEvent ) ); - - hb_itemRelease( pEvent ); + if( found <= listBlock.size() && listBlock.at( found - 1 ) != NULL ) + { + int eventId = s_lstEvent.indexOf( eventtype ); + if( eventId > -1 ) + { + PHBQT_EVENT_FUNC pCallback = s_pEventAllocateCallback.at( eventId ); + if( pCallback ) + { + if( hb_vmRequestReenter() ) + { + ret = hb_itemGetL( hb_vmEvalBlockV( ( PHB_ITEM ) listBlock.at( found - 1 ), 1, hbqt_create_objectGC( ( * pCallback )( event, false ), s_lstCreateObj.at( eventId ) ) ) ); + hb_vmRequestRestore(); + } + } + if( eventtype == QEvent::Close ) + { + event->ignore(); + } + } + } } - hb_vmRequestRestore(); - - if( eventtype == QEvent::Close ) - event->ignore(); } } return ret; diff --git a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp index 6f7d432c55..d3328def60 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp @@ -365,12 +365,10 @@ static void hbqt_SlotsExecQObject( PHB_ITEM * codeBlock, void ** arguments, QStr /*----------------------------------------------------------------------*/ HB_FUNC_EXTERN( HB_QEVENT ); -// HB_FUNC_EXTERN( QMODELINDEX ); void _hbqtcore_force_link_for_event( void ) { HB_FUNC_EXEC( HB_QEVENT ); - // HB_FUNC_EXEC( QMODELINDEX ); } static void hbqt_registerCallbacks( void ) diff --git a/harbour/contrib/hbqt/qtcore/qth/QChildEvent.qth b/harbour/contrib/hbqt/qtcore/qth/QChildEvent.qth new file mode 100644 index 0000000000..fe322b88bd --- /dev/null +++ b/harbour/contrib/hbqt/qtcore/qth/QChildEvent.qth @@ -0,0 +1,100 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2011 Pritpal Bedi + * 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 +; + + +QObject = no +Inherit = QEvent +Type = +New = + + + +#include + + +/* + * QChildEvent ( Type type, QObject * child ) + */ +HB_FUNC( QT_QCHILDEVENT ) +{ + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) + { + __HB_RETPTRGC__( new QChildEvent( ( QEvent::Type ) hb_parni( 1 ), hbqt_par_QObject( 2 ) ) ); + } +} + + + + + + +bool added () const +QObject * child () const +bool polished () const +bool removed () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qtcore/qth/filelist.hbm b/harbour/contrib/hbqt/qtcore/qth/filelist.hbm index 9f3e1cfb53..66fc97afbf 100644 --- a/harbour/contrib/hbqt/qtcore/qth/filelist.hbm +++ b/harbour/contrib/hbqt/qtcore/qth/filelist.hbm @@ -18,6 +18,7 @@ QBitArray.qth QBuffer.qth QByteArray.qth QChar.qth +QChildEvent.qth QCoreApplication.qth QDataStream.qth QDate.qth diff --git a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp index 3815b39544..4beebe80c2 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp @@ -100,6 +100,7 @@ extern void * hbqt_gcAllocate_QTreeWidgetItem( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QTableWidgetItem( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QWidget( void * pObj, bool bNew ); +extern void * hbqt_gcAllocate_QActionEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QContextMenuEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QDragEnterEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QDragLeaveEvent( void * pObj, bool bNew ); @@ -115,12 +116,14 @@ extern void * hbqt_gcAllocate_QGraphicsSceneResizeEvent( void * pObj, bool bNew extern void * hbqt_gcAllocate_QGraphicsSceneWheelEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QHelpEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QHideEvent( void * pObj, bool bNew ); +extern void * hbqt_gcAllocate_QHoverEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QInputMethodEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QKeyEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QMouseEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QMoveEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QPaintEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QResizeEvent( void * pObj, bool bNew ); +extern void * hbqt_gcAllocate_QShortcutEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QShowEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QWheelEvent( void * pObj, bool bNew ); extern void * hbqt_gcAllocate_QWindowStateChangeEvent( void * pObj, bool bNew ); @@ -359,6 +362,7 @@ HB_FUNC_EXTERN( HB_QTREEWIDGETITEM ); /*----------------------------------------------------------------------*/ +HB_FUNC_EXTERN( HB_QACTIONEVENT ); HB_FUNC_EXTERN( HB_QCONTEXTMENUEVENT ); HB_FUNC_EXTERN( HB_QDRAGENTEREVENT ); HB_FUNC_EXTERN( HB_QDRAGLEAVEEVENT ); @@ -376,18 +380,21 @@ HB_FUNC_EXTERN( HB_QGRAPHICSSCENERESIZEEVENT ); HB_FUNC_EXTERN( HB_QGRAPHICSSCENEWHEELEVENT ); HB_FUNC_EXTERN( HB_QHELPEVENT ); HB_FUNC_EXTERN( HB_QHIDEEVENT ); +HB_FUNC_EXTERN( HB_QHOVEREVENT ); HB_FUNC_EXTERN( HB_QINPUTMETHODEVENT ); HB_FUNC_EXTERN( HB_QKEYEVENT ); HB_FUNC_EXTERN( HB_QMOUSEEVENT ); HB_FUNC_EXTERN( HB_QMOVEEVENT ); HB_FUNC_EXTERN( HB_QPAINTEVENT ); HB_FUNC_EXTERN( HB_QRESIZEEVENT ); +HB_FUNC_EXTERN( HB_QSHORTCUTEVENT ); HB_FUNC_EXTERN( HB_QSHOWEVENT ); HB_FUNC_EXTERN( HB_QWHEELEVENT ); HB_FUNC_EXTERN( HB_QWINDOWSTATECHANGEEVENT ); void _hbqtgui_force_link_for_event( void ) { + HB_FUNC_EXEC( HB_QACTIONEVENT ); HB_FUNC_EXEC( HB_QCONTEXTMENUEVENT ); HB_FUNC_EXEC( HB_QDRAGENTEREVENT ); HB_FUNC_EXEC( HB_QDRAGLEAVEEVENT ); @@ -405,6 +412,7 @@ void _hbqtgui_force_link_for_event( void ) HB_FUNC_EXEC( HB_QGRAPHICSSCENEWHEELEVENT ); HB_FUNC_EXEC( HB_QHELPEVENT ); HB_FUNC_EXEC( HB_QHIDEEVENT ); + HB_FUNC_EXEC( HB_QHOVEREVENT ); HB_FUNC_EXEC( HB_QINPUTMETHODEVENT ); HB_FUNC_EXEC( HB_QKEYEVENT ); HB_FUNC_EXEC( HB_QMOUSEEVENT ); @@ -412,6 +420,7 @@ void _hbqtgui_force_link_for_event( void ) HB_FUNC_EXEC( HB_QPAINTEVENT ); HB_FUNC_EXEC( HB_QRESIZEEVENT ); HB_FUNC_EXEC( HB_QSHOWEVENT ); + HB_FUNC_EXEC( HB_QSHORTCUTEVENT ); HB_FUNC_EXEC( HB_QWHEELEVENT ); HB_FUNC_EXEC( HB_QWINDOWSTATECHANGEEVENT ); @@ -520,11 +529,11 @@ static void hbqt_registerCallbacks( void ) hbqt_events_register_createobj( QEvent::ToolTip , "hb_QHelpEvent" , hbqt_gcAllocate_QHelpEvent ); hbqt_events_register_createobj( QEvent::WhatsThis , "hb_QHelpEvent" , hbqt_gcAllocate_QHelpEvent ); hbqt_events_register_createobj( QEvent::StatusTip , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::ActionChanged , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::ActionAdded , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::ActionRemoved , "hb_QEvent" , hbqt_gcAllocate_QEvent ); + hbqt_events_register_createobj( QEvent::ActionChanged , "hb_QActionEvent" , hbqt_gcAllocate_QActionEvent ); + hbqt_events_register_createobj( QEvent::ActionAdded , "hb_QActionEvent" , hbqt_gcAllocate_QActionEvent ); + hbqt_events_register_createobj( QEvent::ActionRemoved , "hb_QActionEvent" , hbqt_gcAllocate_QActionEvent ); hbqt_events_register_createobj( QEvent::FileOpen , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::Shortcut , "hb_QEvent" , hbqt_gcAllocate_QEvent ); + hbqt_events_register_createobj( QEvent::Shortcut , "hb_QShortcutEvent" , hbqt_gcAllocate_QShortcutEvent ); hbqt_events_register_createobj( QEvent::WhatsThisClicked , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::AccessibilityHelp , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::ToolBarChange , "hb_QEvent" , hbqt_gcAllocate_QEvent ); @@ -535,9 +544,9 @@ static void hbqt_registerCallbacks( void ) hbqt_events_register_createobj( QEvent::EnterWhatsThisMode , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::LeaveWhatsThisMode , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::ZOrderChange , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::HoverEnter , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::HoverLeave , "hb_QEvent" , hbqt_gcAllocate_QEvent ); - hbqt_events_register_createobj( QEvent::HoverMove , "hb_QEvent" , hbqt_gcAllocate_QEvent ); + hbqt_events_register_createobj( QEvent::HoverEnter , "hb_QHoverEvent" , hbqt_gcAllocate_QHoverEvent ); + hbqt_events_register_createobj( QEvent::HoverLeave , "hb_QHoverEvent" , hbqt_gcAllocate_QHoverEvent ); + hbqt_events_register_createobj( QEvent::HoverMove , "hb_QHoverEvent" , hbqt_gcAllocate_QHoverEvent ); hbqt_events_register_createobj( QEvent::AccessibilityDescription , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::ParentAboutToChange , "hb_QEvent" , hbqt_gcAllocate_QEvent ); hbqt_events_register_createobj( QEvent::WinEventAct , "hb_QEvent" , hbqt_gcAllocate_QEvent ); @@ -584,8 +593,8 @@ static void hbqt_registerCallbacks( void ) static QApplication * s_app = NULL; -static int s_argc; -static char ** s_argv; +//static int s_argc; +//static char ** s_argv; HB_FUNC_EXTERN( __HBQTCORE ); @@ -605,6 +614,9 @@ QApplication * __hbqtgui_app( void ) static void hbqt_lib_init( void * cargo ) { + static int s_argc; + static char ** s_argv; + HB_SYMBOL_UNUSED( cargo ); s_argc = hb_cmdargARGC(); @@ -616,6 +628,7 @@ static void hbqt_lib_init( void * cargo ) hb_errInternal( 11001, "hbqt_lib_init(): HBQTGUI Initilization Error.", NULL, NULL ); hb_cmdargInit( s_argc, s_argv ); + HB_TRACE( HB_TR_ALWAYS, ( "hbqt_lib_init %p", s_app ) ); hbqt_registerCallbacks(); } @@ -623,6 +636,11 @@ static void hbqt_lib_init( void * cargo ) static void hbqt_lib_exit( void * cargo ) { HB_SYMBOL_UNUSED( cargo ); + HB_TRACE( HB_TR_ALWAYS, ( "hbqt_lib_exit 0" ) ); + s_app->exit( 0 ); + HB_TRACE( HB_TR_ALWAYS, ( "hbqt_lib_exit 1" ) ); + delete s_app; + HB_TRACE( HB_TR_ALWAYS, ( "hbqt_lib_exit 2" ) ); } diff --git a/harbour/contrib/hbqt/qtgui/hbqtgui.hbx b/harbour/contrib/hbqt/qtgui/hbqtgui.hbx index 3b392186b6..abeb7b3861 100644 --- a/harbour/contrib/hbqt/qtgui/hbqtgui.hbx +++ b/harbour/contrib/hbqt/qtgui/hbqtgui.hbx @@ -54,6 +54,7 @@ DYNAMIC HB_QABSTRACTSLIDER DYNAMIC HB_QABSTRACTSPINBOX DYNAMIC HB_QABSTRACTTEXTDOCUMENTLAYOUT DYNAMIC HB_QACTION +DYNAMIC HB_QACTIONEVENT DYNAMIC HB_QACTIONGROUP DYNAMIC HB_QAPPLICATION DYNAMIC HB_QBITMAP @@ -91,6 +92,7 @@ DYNAMIC HB_QDROPEVENT DYNAMIC HB_QERRORMESSAGE DYNAMIC HB_QFILEDIALOG DYNAMIC HB_QFILEICONPROVIDER +DYNAMIC HB_QFILEOPENEVENT DYNAMIC HB_QFILESYSTEMMODEL DYNAMIC HB_QFOCUSEVENT DYNAMIC HB_QFOCUSFRAME @@ -138,6 +140,7 @@ DYNAMIC HB_QHBOXLAYOUT DYNAMIC HB_QHEADERVIEW DYNAMIC HB_QHELPEVENT DYNAMIC HB_QHIDEEVENT +DYNAMIC HB_QHOVEREVENT DYNAMIC HB_QICON DYNAMIC HB_QIMAGE DYNAMIC HB_QIMAGEREADER @@ -202,6 +205,7 @@ DYNAMIC HB_QRESIZEEVENT DYNAMIC HB_QSCROLLAREA DYNAMIC HB_QSCROLLBAR DYNAMIC HB_QSESSIONMANAGER +DYNAMIC HB_QSHORTCUTEVENT DYNAMIC HB_QSHOWEVENT DYNAMIC HB_QSIZEGRIP DYNAMIC HB_QSIZEPOLICY @@ -309,6 +313,7 @@ DYNAMIC QABSTRACTSLIDER DYNAMIC QABSTRACTSPINBOX DYNAMIC QABSTRACTTEXTDOCUMENTLAYOUT DYNAMIC QACTION +DYNAMIC QACTIONEVENT DYNAMIC QACTIONGROUP DYNAMIC QAPPLICATION DYNAMIC QBITMAP @@ -346,6 +351,7 @@ DYNAMIC QDROPEVENT DYNAMIC QERRORMESSAGE DYNAMIC QFILEDIALOG DYNAMIC QFILEICONPROVIDER +DYNAMIC QFILEOPENEVENT DYNAMIC QFILESYSTEMMODEL DYNAMIC QFOCUSEVENT DYNAMIC QFOCUSFRAME @@ -393,6 +399,7 @@ DYNAMIC QHBOXLAYOUT DYNAMIC QHEADERVIEW DYNAMIC QHELPEVENT DYNAMIC QHIDEEVENT +DYNAMIC QHOVEREVENT DYNAMIC QICON DYNAMIC QIMAGE DYNAMIC QIMAGEREADER @@ -457,6 +464,7 @@ DYNAMIC QRESIZEEVENT DYNAMIC QSCROLLAREA DYNAMIC QSCROLLBAR DYNAMIC QSESSIONMANAGER +DYNAMIC QSHORTCUTEVENT DYNAMIC QSHOWEVENT DYNAMIC QSIZEGRIP DYNAMIC QSIZEPOLICY diff --git a/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth new file mode 100644 index 0000000000..73422c99b6 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth @@ -0,0 +1,98 @@ +/* + * $Id: QAction.qth 10801 2009-04-07 06:51:37Z vouchcac $ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2011 Pritpal Bedi + * 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 +; + + +QObject = no +Inherit = QEvent +Type = +New = + + + +#include + + +/* + * QActionEvent ( int type, QAction * action, QAction * before = 0 ) + */ +HB_FUNC( QT_QACTIONEVENT ) +{ + if( hb_pcount() <= 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && ( hb_pcount() == 3 ? HB_ISOBJECT( 3 ) : false ) ) + { + __HB_RETPTRGC__( new QActionEvent( hb_parni( 1 ), hbqt_par_QAction( 2 ), ( HB_ISOBJECT( 3 ) ? hbqt_par_QAction( 3 ) : 0 ) ) ); + } +} + + + + + + +QAction * action () const +QAction * before () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qtgui/qth/QFileOpenEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QFileOpenEvent.qth new file mode 100644 index 0000000000..3819bbd10f --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/qth/QFileOpenEvent.qth @@ -0,0 +1,104 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2011 Pritpal Bedi + * 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 +; + + +QObject = no +Inherit = QEvent +Type = +New = + + + +#include + + +/* + * + */ +HB_FUNC( QT_QFILEOPENEVENT ) +{ + if( hb_pcount() == 1 && ( HB_ISCHAR( 1 ) || HB_ISOBJECT( 1 ) ) ) + { + if( HB_ISCHAR( 1 ) ) + { + __HB_RETPTRGC__( new QFileOpenEvent( hbqt_par_QString( 1 ) ) ); + } + else if( HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QFileOpenEvent( *hbqt_par_QFileOpenEvent( 1 ) ) ); + } + } +} + + + + + + +QString file () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth new file mode 100644 index 0000000000..d7d056d5c6 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth @@ -0,0 +1,98 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2011 Pritpal Bedi + * 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 +; + + +QObject = no +Inherit = QEvent +Type = +New = + + + +#include + + +/* + * QHoverEvent ( Type type, const QPoint & pos, const QPoint & oldPos ) + */ +HB_FUNC( QT_QHOVEREVENT ) +{ + if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) ) + { + __HB_RETPTRGC__( new QHoverEvent( ( QEvent::Type ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); + } +} + + + + + + +const QPoint & oldPos () const +const QPoint & pos () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth index 671259ba99..61baf17cd5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMoveEvent.qth @@ -14,9 +14,9 @@ QObject = no Inherits = QEvent -Type = Core +Type = New = -Constructor = no +Constructor = diff --git a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth index 65b625f634..2bf4d2b8cc 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth @@ -14,7 +14,7 @@ QObject = no Inherits = QEvent -Type = Core +Type = New = @@ -30,13 +30,11 @@ HB_FUNC( QT_QPAINTEVENT ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - QString objName = ( QString ) hbqt_par_QString( 1 ); - - if( objName == ( QString ) "QRect" ) + if( hbqt_isObjectType( 1, HBQT_TYPE_QRegion ) ) { __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QRegion( 1 ) ) ); } - else if( objName == ( QString ) "QRegion" ) + else if( hbqt_isObjectType( 1, HBQT_TYPE_QRect ) ) { __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QRect( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth new file mode 100644 index 0000000000..bc17c3996a --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth @@ -0,0 +1,100 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2011 Pritpal Bedi + * 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 +; + + +QObject = no +Inherit = QEvent +Type = +New = + + + +#include + + +/* + * QShortcutEvent ( const QKeySequence & key, int id, bool ambiguous = false ) + * ~QShortcutEvent () + */ +HB_FUNC( QT_QSHORTCUTEVENT ) +{ + if( hb_pcount() >= 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QShortcutEvent( *hbqt_par_QKeySequence( 1 ), hb_parni( 2 ), ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : false ) ) ); + } +} + + + + + + +bool isAmbiguous () const +const QKeySequence & key () const +int shortcutId () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qtgui/qth/filelist.hbm b/harbour/contrib/hbqt/qtgui/qth/filelist.hbm index 0bde8cf5fb..bec131d35e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/filelist.hbm +++ b/harbour/contrib/hbqt/qtgui/qth/filelist.hbm @@ -25,6 +25,7 @@ QAbstractSlider.qth QAbstractSpinBox.qth QAbstractTextDocumentLayout.qth QAction.qth +QActionEvent.qth QActionGroup.qth QApplication.qth QBitmap.qth @@ -62,6 +63,7 @@ QDropEvent.qth QErrorMessage.qth QFileDialog.qth QFileIconProvider.qth +QFileOpenEvent.qth QFileSystemModel.qth QFocusEvent.qth QFocusFrame.qth @@ -109,6 +111,7 @@ QHBoxLayout.qth QHeaderView.qth QHelpEvent.qth QHideEvent.qth +QHoverEvent.qth QIcon.qth QImage.qth QImageReader.qth @@ -175,6 +178,7 @@ QResizeEvent.qth QScrollArea.qth QScrollBar.qth QSessionManager.qth +QShortcutEvent.qth QShowEvent.qth QSizeGrip.qth QSizePolicy.qth