diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c858e222a2..6bca63fd12 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,38 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-07 22:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/hbqtgen.prg + + * harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp + * harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp + * harbour/contrib/hbqt/hbqt_qcombobox.cpp + * harbour/contrib/hbqt/hbqt_qdirmodel.cpp + * harbour/contrib/hbqt/hbqt_qicon.cpp + * harbour/contrib/hbqt/hbqt_qimage.cpp + * harbour/contrib/hbqt/hbqt_qpainter.cpp + * harbour/contrib/hbqt/hbqt_qpixmap.cpp + * harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp + * harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp + * harbour/contrib/hbqt/hbqt_qtextdocument.cpp + * harbour/contrib/hbqt/hbqt_qwebview.cpp + + * harbour/contrib/hbqt/hbqt_slots.cpp + * harbour/contrib/hbqt/hbqt_slots.h + * harbour/contrib/hbqt/moc_slots.cpp + + * harbour/contrib/hbqt/tests/demoqt.prg + + ! HB_ISNIL() => HB_ISPOINTER() + + Added more event handlers. + + Cleaned up hbqtgen.prg. + + /* + Now almost all the controls have events response in place. + The exception is QListView(). I am struggling to understand + why this widget do not respnd to events. + */ + 2009-06-08 06:30 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Added minimum tested version of MinGW. diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 40d0d8d429..c7fe710fc9 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -710,22 +710,15 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) CASE aA[ PRT_L_AND ] .and. aA[ PRT_L_CONST ] s := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' IF !empty( aA[ PRT_DEFAULT ] ) .and. ( '(' $ aA[ PRT_DEFAULT ] ) - aA[ PRT_BODY ] := '( HB_ISNIL( '+cHBIdx+' ) ? ' + aA[ PRT_DEFAULT ] +' : '+ s +' )' + //aA[ PRT_BODY ] := '( HB_ISNIL( '+cHBIdx+' ) ? ' + aA[ PRT_DEFAULT ] +' : '+ s +' )' + aA[ PRT_BODY ] := '( HB_ISPOINTER( '+cHBIdx+' ) ? '+ s + ' : ' +aA[ PRT_DEFAULT ] +' )' ELSE aA[ PRT_BODY ] := s ENDIF aA[ PRT_DOC ] := 'p'+ cDocNM - #if 0 - aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'p'+ cDocNM - #endif CASE aA[ PRT_L_AND ] - #if 0 - aA[ PRT_BODY ] := '( '+ aA[ PRT_CAST ]+'& )' + 'hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' - #else - aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' - #endif + aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' aA[ PRT_DOC ] := 'p'+ cDocNM OTHERWISE @@ -753,10 +746,6 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) DO CASE CASE aA[ PRT_CAST ] == 'T' - #if 0 - cCmd := 'hb_ret( '+ cCmn +' )' - cPrgRet := 'x'+cDocNM - #endif cCmd := 'hb_retptr( '+ cCmn +' )' cPrgRet := 'p'+cDocNM @@ -801,73 +790,21 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) cPrgRet := 'p'+cDocNM CASE aA[ PRT_L_AND ] .and. aA[ PRT_L_CONST ] - #if 0 - cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )' - #else - cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - #endif + cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' cPrgRet := 'p'+cDocNM CASE aA[ PRT_L_CONST ] - #if 0 - cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + ' ) ' + cCmn + ' ) )' - #else - cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - #endif + cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' cPrgRet := 'p'+cDocNM CASE aA[ PRT_L_AND ] cCmd := 'hb_retptr( ( '+ aA[ PRT_CAST ] + '* ) ' + cCmn + ' )' cPrgRet := 'p'+cDocNM -#if 0 - CASE aA[ PRT_CAST ] == 'HFONT' - cCmd := 'hb_retptr( ( HFONT ) '+ cCmn +' )' - cPrgRet := 'h'+cDocNM - CASE aA[ PRT_CAST ] == 'HDC' - cCmd := 'hb_retptr( ( HDC ) '+ cCmn +' )' - cPrgRet := 'h'+cDocNM - - CASE aA[ PRT_CAST ] == 'WId' - cCmd := 'hb_retptr( ( HWND ) '+ cCmn +' )' - cPrgRet := 'h'+cDocNM - - CASE aA[ PRT_CAST ] == 'HRGN' - cCmd := 'hb_retptr( ( HRGN ) '+ cCmn +' )' - cPrgRet := 'h'+cDocNM - - CASE aA[ PRT_CAST ] == 'QRect' - cCmd := 'hbqt_ret_QRect( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM - - CASE aA[ PRT_CAST ] == 'QRectF' - cCmd := 'hbqt_ret_QRectF( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM - - CASE aA[ PRT_CAST ] == 'QSize' - cCmd := 'hbqt_ret_QSize( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM - - CASE aA[ PRT_CAST ] == 'QSizeF' - cCmd := 'hbqt_ret_QSizeF( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM - - CASE aA[ PRT_CAST ] == 'QPoint' - cCmd := 'hbqt_ret_QPoint( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM - - CASE aA[ PRT_CAST ] == 'QPointF' - cCmd := 'hbqt_ret_QPointF( '+ cCmn +' )' - cPrgRet := 'a'+cDocNM -#endif OTHERWISE /* No attribute is attached to return value */ IF left( aA[ PRT_CAST ], 1 ) == 'Q' - #if 0 - cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )' - #else - cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - #endif + cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' cPrgRet := 'p'+cDocNM ELSE @@ -1877,41 +1814,48 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut ) BuildHeader( @txt_, 2 ) - aadd( txt_, ' ' ) - aadd( txt_, '#ifndef SLOTS_H ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#define SLOTS_H ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include ' ) - aadd( txt_, '#include ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include "hbapi.h" ' ) - aadd( txt_, '#include "hbapiitm.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'class Slots: public QObject ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' Q_OBJECT ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' public: ' ) - aadd( txt_, ' Slots( QObject *parent = 0 ); ' ) - aadd( txt_, ' ~Slots(); ' ) - aadd( txt_, ' QList list1; ' ) - aadd( txt_, ' QList list2; ' ) - aadd( txt_, ' QList list3; ' ) - aadd( txt_, ' QList list4; ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' public slots: ' ) - aadd( txt_, ' void clicked(); ' ) - aadd( txt_, ' void triggered(); ' ) - aadd( txt_, ' void triggered( bool checked ); ' ) - aadd( txt_, ' void hovered(); ' ) - aadd( txt_, ' void stateChanged( int state ); ' ) - aadd( txt_, ' void pressed(); ' ) - aadd( txt_, ' void released(); ' ) - aadd( txt_, '}; ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#ifndef SLOTS_H ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#define SLOTS_H ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include "hbapi.h" ' ) + aadd( txt_, '#include "hbapiitm.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'class Slots: public QObject ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' Q_OBJECT ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' public: ' ) + aadd( txt_, ' Slots( QObject *parent = 0 ); ' ) + aadd( txt_, ' ~Slots(); ' ) + aadd( txt_, ' QList list1; ' ) + aadd( txt_, ' QList list2; ' ) + aadd( txt_, ' QList list3; ' ) + aadd( txt_, ' QList list4; ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' public slots: ' ) + aadd( txt_, ' void clicked(); ' ) + aadd( txt_, ' void triggered(); ' ) + aadd( txt_, ' void triggered( bool checked ); ' ) + aadd( txt_, ' void hovered(); ' ) + aadd( txt_, ' void stateChanged( int state ); ' ) + aadd( txt_, ' void pressed(); ' ) + aadd( txt_, ' void released(); ' ) + aadd( txt_, ' void activated( int index ); ' ) + aadd( txt_, ' void currentIndexChanged( int index ); ' ) + aadd( txt_, ' void highlighted( int index ); ' ) + aadd( txt_, ' void returnPressed(); ' ) + aadd( txt_, ' void clicked_model( const QModelIndex & index ); ' ) + aadd( txt_, ' void viewportEntered(); ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) @@ -1947,341 +1891,368 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut ) aadd( txt_, ' ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) - aadd( txt_, 'static Slots *s = NULL; ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'static void SlotsExec( QWidget* widget, QString event, PHB_ITEM pItem ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QWidget* ) s->list1.at( i ) == widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' if( pItem != NULL ) ' ) - aadd( txt_, ' hb_itemRelease( pItem ); ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'Slots::Slots( QObject* parent ) : QObject( parent ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'Slots::~Slots() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::clicked() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' SlotsExec( widget, ( QString ) "clicked()", NULL ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' #if 0 ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QWidget* ) list1.at( i ) == ( QWidget* ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "clicked()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' #endif ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::triggered() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QObject *widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "triggered()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::triggered( bool checked ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QObject *widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "triggered(bool)" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); ' ) - aadd( txt_, ' PHB_ITEM pChecked = hb_itemPutL( NULL, checked ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pChecked ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pChecked ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::hovered() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QObject *widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "hovered()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::stateChanged( int state ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget * widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QWidget * ) list1.at( i ) == ( QWidget * ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "stateChanged(int)" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) - aadd( txt_, ' PHB_ITEM pState = hb_itemPutNI( NULL, state ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pState ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pState ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::pressed() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget * widget = qobject_cast(sender()); ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QWidget * ) list1.at( i ) == ( QWidget * ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "pressed()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, (QWidget *) widget ); ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void Slots::released() ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget* widget = qobject_cast( sender() ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( QWidget* ) list1.at( i ) == ( QWidget* ) widget ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "released()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) - aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); ' ) - aadd( txt_, ' hb_itemRelease( pWidget ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#if 0 ' ) - aadd( txt_, 'HB_FUNC( QT_CONNECT_SIGNAL_1 ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ ' ) - aadd( txt_, ' int signal = hb_parni( 2 ); /* get signal */ ' ) - aadd( txt_, ' PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ ' ) - aadd( txt_, ' bool ret = false; /* return value */ ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* create object s, if not created yet */ ' ) - aadd( txt_, ' if( s == NULL ) ' ) - aadd( txt_, ' s = new Slots(); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* connect signal with slot ' ) - aadd( txt_, ' // if the list become to long, more classes can be created ' ) - aadd( txt_, ' // TODO: parameter Qt::AutoConnection ' ) - aadd( txt_, ' */ ' ) - aadd( txt_, ' switch( signal ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' case HBQT_EVT_CLICKED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_TRIGGERED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_TRIGGERED_BOOL: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_HOVERED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_STATECHANGED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_PRESSED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' case HBQT_EVT_RELEASED: ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' break; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // return connect result ' ) - aadd( txt_, ' hb_retl( ret ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // if connected: store widget, signal, codeblock and flag ' ) - aadd( txt_, ' // TODO: locate a inactive entry and use it ' ) - aadd( txt_, ' if( ret == true ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' s->list1 << widget; ' ) - aadd( txt_, ' s->list2 << signal; ' ) - aadd( txt_, ' s->list3 << codeblock; ' ) - aadd( txt_, ' s->list4 << true; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/* ' ) - aadd( txt_, 'harbour function to connect signals with slots ' ) - aadd( txt_, '*/ ' ) - aadd( txt_, 'HB_FUNC( QT_CONNECT_SIGNAL ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ ' ) - aadd( txt_, ' QString signal = hb_parc( 2 ); /* get signal */ ' ) - aadd( txt_, ' PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ ' ) - aadd( txt_, ' bool ret = false; /* return value */ ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* create object s, if not created yet */ ' ) - aadd( txt_, ' if( s == NULL ) ' ) - aadd( txt_, ' s = new Slots(); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* connect signal with slot ' ) - aadd( txt_, ' // if the list become to long, more classes can be created ' ) - aadd( txt_, ' // TODO: parameter Qt::AutoConnection ' ) - aadd( txt_, ' */ ' ) - aadd( txt_, ' if( signal == ( QString ) "clicked()" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "triggered()" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "triggered(bool)" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "hovered()" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "stateChanged(int)" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "pressed()" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' if( signal == ( QString ) "released()" ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // return connect result ' ) - aadd( txt_, ' hb_retl( ret ); ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // if connected: store widget, signal, codeblock and flag ' ) - aadd( txt_, ' // TODO: locate a inactive entry and use it ' ) - aadd( txt_, ' if( ret == true ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' s->list1 << widget; ' ) - aadd( txt_, ' s->list2 << signal; ' ) - aadd( txt_, ' s->list3 << codeblock; ' ) - aadd( txt_, ' s->list4 << true; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/* ' ) - aadd( txt_, 'harbour function to disconnect signals ' ) - aadd( txt_, '*/ ' ) - aadd( txt_, 'HB_FUNC( QT_DISCONNECT_SIGNAL ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' /* TODO */ ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/* ' ) - aadd( txt_, 'harbour function to release all codeblocks storeds ' ) - aadd( txt_, '*/ ' ) - aadd( txt_, '#if 0 ' ) - aadd( txt_, 'HB_FUNC( RELEASE_CODEBLOCKS ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' if( s ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( bool ) s->list4.at( i ) == true ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/* ' ) - aadd( txt_, 'C function to release all codeblocks storeds ' ) - aadd( txt_, 'called at end of the program ' ) - aadd( txt_, 'see qapplication.cpp ' ) - aadd( txt_, '*/ ' ) - aadd( txt_, 'void release_codeblocks( void ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' if( s ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' if( ( bool ) s->list4.at( i ) == true ) ' ) - aadd( txt_, ' { ' ) - aadd( txt_, ' hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' } ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, '' ) - + aadd( txt_, 'static Slots *s = NULL; ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static void SlotsExec( QWidget* widget, QString event, PHB_ITEM pItem ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( QWidget* ) s->list1.at( i ) == widget ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( pItem != NULL ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' hb_itemRelease( pItem ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static void SlotsExecInt( QWidget* widget, QString event, PHB_ITEM pItem, int iValue ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( QWidget* ) s->list1.at( i ) == widget ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pState = hb_itemPutNI( NULL, iValue ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 2, pWidget, pState ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pState ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( pItem != NULL ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' hb_itemRelease( pItem ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'Slots::Slots( QObject* parent ) : QObject( parent ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'Slots::~Slots() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::clicked() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "clicked()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::returnPressed() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "returnPressed()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::viewportEntered() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "viewportEntered()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::pressed() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "pressed()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::released() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "released()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::hovered() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "hovered()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::triggered() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExec( widget, ( QString ) "triggered()", NULL ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::triggered( bool checked ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QObject *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "triggered(bool)" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pChecked = hb_itemPutL( NULL, checked ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pChecked ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pChecked ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::stateChanged( int state ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExecInt( widget, ( QString ) "stateChanged(int)", NULL, state ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::activated( int index ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExecInt( widget, ( QString ) "activated(int)", NULL, index ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::currentIndexChanged( int index ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExecInt( widget, ( QString ) "currentIndexChanged(int)", NULL, index ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::highlighted( int index ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget *widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' SlotsExecInt( widget, ( QString ) "highlighted(int)", NULL, index ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::clicked_model( const QModelIndex & index ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget * widget = qobject_cast( sender() ); ' ) + aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( QWidget * ) list1.at( i ) == ( QWidget * ) widget ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "clicked(QModelIndex)" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pState = hb_itemPutPtr( NULL, ( QModelIndex * ) new QModelIndex( index ) ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget, pState ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pState ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * harbour function to connect signals with slots ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, 'HB_FUNC( QT_CONNECT_SIGNAL ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ ' ) + aadd( txt_, ' QString signal = hb_parc( 2 ); /* get signal */ ' ) + aadd( txt_, ' PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ ' ) + aadd( txt_, ' bool ret = false; /* return value */ ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* create object s, if not created yet */ ' ) + aadd( txt_, ' if( s == NULL ) ' ) + aadd( txt_, ' s = new Slots(); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* connect signal with slot ' ) + aadd( txt_, ' * if the list become to long, more classes can be created ' ) + aadd( txt_, ' * TODO: parameter Qt::AutoConnection ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Events with no parameters */ ' ) + aadd( txt_, ' if( signal == ( QString ) "clicked()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "returnPressed()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( returnPressed() ) , s, SLOT( returnPressed() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "triggered()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "hovered()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "viewportEntered()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( viewportEntered() ), s, SLOT( viewportEntered() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "pressed()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "released()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' /* Events with int parameter */ ' ) + aadd( txt_, ' if( signal == ( QString ) "stateChanged(int)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "activated(int)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( activated( int ) ) , s, SLOT( activated( int ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "currentIndexChanged(int)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( currentIndexChanged( int ) ), s, SLOT( currentIndexChanged( int ) ), Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "highlighted(int)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( highlighted( int ) ) , s, SLOT( highlighted( int ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' /* Events with bool parameter */ ' ) + aadd( txt_, ' if( signal == ( QString ) "triggered(bool)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' /* Events with miscellaneous parameters */ ' ) + aadd( txt_, ' if( signal == ( QString ) "clicked(QModelIndex)" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( clicked_model( const QModelIndex & ) ), s, SLOT( clicked( const QModelIndex & ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* return connect result */ ' ) + aadd( txt_, ' hb_retl( ret ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* if connected: store widget, signal, codeblock and flag ' ) + aadd( txt_, ' * TODO: locate a inactive entry and use it ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, ' if( ret == true ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' s->list1 << widget; ' ) + aadd( txt_, ' s->list2 << signal; ' ) + aadd( txt_, ' s->list3 << codeblock; ' ) + aadd( txt_, ' s->list4 << true; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * harbour function to disconnect signals ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, 'HB_FUNC( QT_DISCONNECT_SIGNAL ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' /* TODO */ ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * harbour function to release all codeblocks storeds ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, '#if 0 ' ) + aadd( txt_, 'HB_FUNC( RELEASE_CODEBLOCKS ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' if( s ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( bool ) s->list4.at( i ) == true ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * C function to release all codeblocks storeds ' ) + aadd( txt_, ' * called at end of the program ' ) + aadd( txt_, ' * see qapplication.cpp ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, 'void release_codeblocks( void ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' if( s ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' if( ( bool ) s->list4.at( i ) == true ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#if 0 ' ) + aadd( txt_, 'HB_FUNC( QT_CONNECT_SIGNAL_1 ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ ' ) + aadd( txt_, ' int signal = hb_parni( 2 ); /* get signal */ ' ) + aadd( txt_, ' PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ ' ) + aadd( txt_, ' bool ret = false; /* return value */ ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* create object s, if not created yet */ ' ) + aadd( txt_, ' if( s == NULL ) ' ) + aadd( txt_, ' s = new Slots(); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* connect signal with slot ' ) + aadd( txt_, ' * if the list become to long, more classes can be created ' ) + aadd( txt_, ' * TODO: parameter Qt::AutoConnection ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, ' switch( signal ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' case HBQT_EVT_CLICKED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_TRIGGERED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_TRIGGERED_BOOL: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_HOVERED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_STATECHANGED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_PRESSED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' case HBQT_EVT_RELEASED: ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' break; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* return connect result */ ' ) + aadd( txt_, ' hb_retl( ret ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* if connected: store widget, signal, codeblock and flag ' ) + aadd( txt_, ' * TODO: locate a inactive entry and use it ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, ' if( ret == true ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' s->list1 << widget; ' ) + aadd( txt_, ' s->list2 << signal; ' ) + aadd( txt_, ' s->list3 << codeblock; ' ) + aadd( txt_, ' s->list4 << true; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) @@ -2291,102 +2262,111 @@ STATIC FUNCTION Build_MOC_SLOTS_CPP( cPathOut ) LOCAL cFile := cPathOut + s_PathSep + 'moc_slots.cpp' LOCAL txt_:={} - aadd( txt_, '/**************************************************************************** ' ) - aadd( txt_, '** Meta object code from reading C++ file "slots.h" ' ) - aadd( txt_, '** ' ) - aadd( txt_, '** Created: Wed 18. Mar 17:25:39 2009 ' ) - aadd( txt_, '** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ' ) - aadd( txt_, '** ' ) - aadd( txt_, '** WARNING! All changes made in this file will be lost! ' ) - aadd( txt_, '*****************************************************************************/' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include "hbqt.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#if QT_VERSION >= 0x040500 ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include "hbqt_slots.h" ' ) - aadd( txt_, '#if !defined(Q_MOC_OUTPUT_REVISION) ' ) - aadd( txt_, '#error "The header file [slots.h] doesn,t include ." ' ) - aadd( txt_, '#elif Q_MOC_OUTPUT_REVISION != 61 ' ) - aadd( txt_, '#error "This file was generated using the moc from 4.5.0. It" ' ) - aadd( txt_, '#error "cannot be used with the include files from this version of Qt." ' ) - aadd( txt_, '#error "(The moc has changed too much.)" ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'QT_BEGIN_MOC_NAMESPACE ' ) - aadd( txt_, 'static const uint qt_meta_data_Slots[] = { ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // content: ' ) - aadd( txt_, ' 2, // revision ' ) - aadd( txt_, ' 0, // classname ' ) - aadd( txt_, ' 0, 0, // classinfo ' ) - aadd( txt_, ' 7, 12, // methods ' ) - aadd( txt_, ' 0, 0, // properties ' ) - aadd( txt_, ' 0, 0, // enums/sets ' ) - aadd( txt_, ' 0, 0, // constructors ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' // slots: signature, parameters, type, tag, flags ' ) - aadd( txt_, ' 7, 6, 6, 6, 0x0a, ' ) - aadd( txt_, ' 17, 6, 6, 6, 0x0a, ' ) - aadd( txt_, ' 37, 29, 6, 6, 0x0a, ' ) - aadd( txt_, ' 53, 6, 6, 6, 0x0a, ' ) - aadd( txt_, ' 69, 63, 6, 6, 0x0a, ' ) - aadd( txt_, ' 87, 6, 6, 6, 0x0a, ' ) - aadd( txt_, ' 97, 6, 6, 6, 0x0a, ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' 0 // eod ' ) - aadd( txt_, '}; ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'static const char qt_meta_stringdata_Slots[] = { ' ) - aadd( txt_, ' "Slots\0\0clicked()\0triggered()\0checked\0" ' ) - aadd( txt_, ' "triggered(bool)\0hovered()\0state\0" ' ) - aadd( txt_, ' "stateChanged(int)\0pressed()\0released()\0" ' ) - aadd( txt_, '}; ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'const QMetaObject Slots::staticMetaObject = { ' ) - aadd( txt_, ' { &QObject::staticMetaObject, qt_meta_stringdata_Slots, ' ) - aadd( txt_, ' qt_meta_data_Slots, 0 } ' ) - aadd( txt_, '}; ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'const QMetaObject *Slots::metaObject() const ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' return &staticMetaObject; ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'void *Slots::qt_metacast(const char *_clname) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' if (!_clname) return 0; ' ) - aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_Slots)) ' ) - aadd( txt_, ' return static_cast(const_cast< Slots*>(this)); ' ) - aadd( txt_, ' return QObject::qt_metacast(_clname); ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' _id = QObject::qt_metacall(_c, _id, _a); ' ) - aadd( txt_, ' if (_id < 0) ' ) - aadd( txt_, ' return _id; ' ) - aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' ) - aadd( txt_, ' switch (_id) { ' ) - aadd( txt_, ' case 0: clicked(); break; ' ) - aadd( txt_, ' case 1: triggered(); break; ' ) - aadd( txt_, ' case 2: triggered((*reinterpret_cast< bool(*)>(_a[1]))); break; ' ) - aadd( txt_, ' case 3: hovered(); break; ' ) - aadd( txt_, ' case 4: stateChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' ) - aadd( txt_, ' case 5: pressed(); break; ' ) - aadd( txt_, ' case 6: released(); break; ' ) - aadd( txt_, ' default: ; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' _id -= 7; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' return _id; ' ) - aadd( txt_, '} ' ) - aadd( txt_, 'QT_END_MOC_NAMESPACE ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) + /* .......................................................................................................' */ + + aadd( txt_, '/**************************************************************************** ' ) + aadd( txt_, '** Meta object code from reading C++ file hbqt_slots.h ' ) + aadd( txt_, '** ' ) + aadd( txt_, '** Created: Sun Jun 7 21:29:21 2009 ' ) + aadd( txt_, '** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ' ) + aadd( txt_, '** ' ) + aadd( txt_, '** WARNING! All changes made in this file will be lost! ' ) + aadd( txt_, '*****************************************************************************/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include "hbqt_slots.h" ' ) + aadd( txt_, '#if !defined(Q_MOC_OUTPUT_REVISION) ' ) + aadd( txt_, '#error "The header file hbqt_slots.h doesnt include ." ' ) + aadd( txt_, '#elif Q_MOC_OUTPUT_REVISION != 61 ' ) + aadd( txt_, '#error "This file was generated using the moc from 4.5.0. It" ' ) + aadd( txt_, '#error "cannot be used with the include files from this version of Qt." ' ) + aadd( txt_, '#error "(The moc has changed too much.)" ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'QT_BEGIN_MOC_NAMESPACE ' ) + aadd( txt_, 'static const uint qt_meta_data_Slots[] = { ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' // content: ' ) + aadd( txt_, ' 2, // revision ' ) + aadd( txt_, ' 0, // classname ' ) + aadd( txt_, ' 0, 0, // classinfo ' ) + aadd( txt_, ' 13, 12, // methods ' ) + aadd( txt_, ' 0, 0, // properties ' ) + aadd( txt_, ' 0, 0, // enums/sets ' ) + aadd( txt_, ' 0, 0, // constructors ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' // slots: signature, parameters, type, tag, flags ' ) + aadd( txt_, ' 7, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 17, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 37, 29, 6, 6, 0x0a, ' ) + aadd( txt_, ' 53, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 69, 63, 6, 6, 0x0a, ' ) + aadd( txt_, ' 87, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 97, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 114, 108, 6, 6, 0x0a, ' ) + aadd( txt_, ' 129, 108, 6, 6, 0x0a, ' ) + aadd( txt_, ' 154, 108, 6, 6, 0x0a, ' ) + aadd( txt_, ' 171, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' 187, 108, 6, 6, 0x0a, ' ) + aadd( txt_, ' 214, 6, 6, 6, 0x0a, ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' 0 // eod ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static const char qt_meta_stringdata_Slots[] = { ' ) + aadd( txt_, ' "Slots\0\0clicked()\0triggered()\0checked\0" ' ) + aadd( txt_, ' "triggered(bool)\0hovered()\0state\0" ' ) + aadd( txt_, ' "stateChanged(int)\0pressed()\0released()\0" ' ) + aadd( txt_, ' "index\0activated(int)\0currentIndexChanged(int)\0" ' ) + aadd( txt_, ' "highlighted(int)\0returnPressed()\0" ' ) + aadd( txt_, ' "clicked_model(QModelIndex)\0viewportEntered()\0" ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject Slots::staticMetaObject = { ' ) + aadd( txt_, ' { &QObject::staticMetaObject, qt_meta_stringdata_Slots, ' ) + aadd( txt_, ' qt_meta_data_Slots, 0 } ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject *Slots::metaObject() const ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' return &staticMetaObject; ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void *Slots::qt_metacast(const char *_clname) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' if (!_clname) return 0; ' ) + aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_Slots)) ' ) + aadd( txt_, ' return static_cast(const_cast< Slots*>(this)); ' ) + aadd( txt_, ' return QObject::qt_metacast(_clname); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' _id = QObject::qt_metacall(_c, _id, _a); ' ) + aadd( txt_, ' if (_id < 0) ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' ) + aadd( txt_, ' switch (_id) { ' ) + aadd( txt_, ' case 0: clicked(); break; ' ) + aadd( txt_, ' case 1: triggered(); break; ' ) + aadd( txt_, ' case 2: triggered((*reinterpret_cast< bool(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 3: hovered(); break; ' ) + aadd( txt_, ' case 4: stateChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 5: pressed(); break; ' ) + aadd( txt_, ' case 6: released(); break; ' ) + aadd( txt_, ' case 7: activated((*reinterpret_cast< int(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 8: currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 9: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 10: returnPressed(); break; ' ) + aadd( txt_, ' case 11: clicked_model((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 12: viewportEntered(); break; ' ) + aadd( txt_, ' default: ; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' _id -= 13; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'QT_END_MOC_NAMESPACE ' ) + aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) @@ -2398,673 +2378,694 @@ STATIC FUNCTION Build_Demo() BuildHeader( @txt_, 2 ) - aadd( txt_, '#define QT_PTROF( oObj ) ( oObj:pPtr ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#define QT_EVE_TRIGGERED "triggered(bool)" ' ) - aadd( txt_, '#define QT_EVE_TRIGGERED_B "triggered(bool)" ' ) - aadd( txt_, '#define QT_EVE_HOVERED "hovered()" ' ) - aadd( txt_, '#define QT_EVE_CLICKED "clicked()" ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, '/* ' ) - aadd( txt_, ' * A NOTE ' ) - aadd( txt_, ' * ' ) - aadd( txt_, ' * This demo is built on auto generated classes by the engine. No attemp ' ) - aadd( txt_, ' * is exercised to refine the way the code must be written. At this moment ' ) - aadd( txt_, ' * my emphasis is on testing phase of QT wrapper functions and classes ' ) - aadd( txt_, ' * generated thereof. In near future the actual implementation will be ' ) - aadd( txt_, ' * based on the Xbase++ XBPParts compatible framework. You just are ' ) - aadd( txt_, ' * encouraged to sense the power of QT through this expression. ' ) - aadd( txt_, ' * ' ) - aadd( txt_, ' * Pritpal Bedi ' ) - aadd( txt_, ' */ ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'INIT PROCEDURE Qt_Start() ' ) - aadd( txt_, ' qt_qapplication() ' ) - aadd( txt_, ' /*qt_qapplication_setstyle( QT_PTROF( QWindowsXPStyle():new() ) )*/ ' ) - aadd( txt_, ' RETURN ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'EXIT PROCEDURE Qt_End() ' ) - aadd( txt_, ' qt_qapplication_exec() ' ) - aadd( txt_, ' RETURN ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'PROCEDURE Main() ' ) - aadd( txt_, ' Local oLabel, oBtn, oDA, oTabBar ' ) - aadd( txt_, ' Local oWnd, oSize ' ) - aadd( txt_, ' Local oMenuBar, pIcon ' ) - aadd( txt_, ' Local oMenuA, pAction ' ) - aadd( txt_, ' LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oWnd := QMainWindow():new() ' ) - aadd( txt_, ' oWnd:setWindowTitle( "Testing - QMainWindow, QMenu, QMenuBar and QAction " ) ' ) - aadd( txt_, ' oWnd:setWindowIcon( "test" ) ' ) - aadd( txt_, ' pIcon := oWnd:windowIcon() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* The method 2 */ ' ) - aadd( txt_, ' oWnd:resize( 900, 500 ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oDA := QWidget():new( oWnd ) ' ) - aadd( txt_, ' oWnd:setCentralWidget( QT_PTROF( oDA ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' Build_MenuBar( oWnd ) ' ) - aadd( txt_, ' Build_ToolBar( oWnd ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oSBar := QStatusBar():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oWnd:setStatusBar( QT_PTROF( oSBar ) ) ' ) - aadd( txt_, ' oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oStyle := QWindowsXPStyle() ' ) - aadd( txt_, ' oStyle:standardIcon( 2 ) ' ) - aadd( txt_, ' oWnd:setStyle( QT_PTROF( oStyle ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' Build_Label( oDA, { 30,190 }, { 300, 30 } ) ' ) - aadd( txt_, ' Build_PushButton( oDA, { 30,240 }, { 100,50 } ) ' ) - aadd( txt_, ' Build_Grid( oDA, { 30, 30 }, { 450,150 } ) ' ) - aadd( txt_, ' Build_Tabs( oDA, { 510, 5 }, { 360, 400 } ) ' ) - aadd( txt_, ' Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) ' ) - aadd( txt_, ' Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oWnd:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_MenuBar( oWnd ) ' ) - aadd( txt_, ' LOCAL oMenuBar, oMenu ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oMenuBar := QMenuBar():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oMenuBar:resize( oWnd:width(), 25 ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' ) - aadd( txt_, ' oMenu:setTitle( "&File" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } ) ' ) - aadd( txt_, ' oMenu:addSeparator() ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Save" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save", w, l ) } ) ' ) - aadd( txt_, ' oMenu:addSeparator() ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| MsgInfo( "Exit ?" ) } ) ' ) - aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' ) - aadd( txt_, ' oMenu:setTitle( "&Dialogs" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) ' ) - aadd( txt_, ' oMenu:addSeparator() ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&PageSetup" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "P&review" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview" , w, l ) } ) ' ) - aadd( txt_, ' oMenu:addSeparator() ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Wizard" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard" , w, l ) } ) ' ) - aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "W&ebPage" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage" , w, l ) } ) ' ) - aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oWnd:setMenuBar( QT_PTROF( oMenuBar ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_ToolBar( oWnd ) ' ) - aadd( txt_, ' LOCAL oTB, oAct ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Create a Toolbar Object */ ' ) - aadd( txt_, ' oTB := QToolBar():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Create an action */ ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&New" ) ' ) - aadd( txt_, ' oAct:setIcon( "new.png" ) ' ) - aadd( txt_, ' oAct:setToolTip( "A New File" ) ' ) - aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) ' ) - aadd( txt_, ' /* Attach Action with Toolbar */ ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Create another action */ ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Open" ) ' ) - aadd( txt_, ' oAct:setIcon( "open.png" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Select a file to be opened!" ) ' ) - aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open" , w, l ) } ) ' ) - aadd( txt_, ' /* Attach Action with Toolbar */ ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTB:addSeparator() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Create another action */ ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Save" ) ' ) - aadd( txt_, ' oAct:setIcon( "save.png" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Save this file!" ) ' ) - aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save" , w, l ) } ) ' ) - aadd( txt_, ' /* Attach Action with Toolbar */ ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Add this toolbar with main window */ ' ) - aadd( txt_, ' oWnd:addToolBar_1( QT_PTROF( oTB ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /////////////////////////////////////////////////////////// ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Build another toolbar - we will have two toolbats now */ ' ) - aadd( txt_, ' oTB := QToolBar():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Colors" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Colors Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Fonts" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Fonts Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTB:addSeparator() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&PgSetup" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Page Setup Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Preview" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Page Preview Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTB:addSeparator() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Webpage" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Web Browser Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oAct:setText( "&Wizard" ) ' ) - aadd( txt_, ' oAct:setToolTip( "Generic Wizard Dialog" ) ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard", w, l ) } ) ' ) - aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' /* Add this toolbar with main window */ ' ) - aadd( txt_, ' oWnd:addToolBar_1( QT_PTROF( oTB ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oBtn ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oBtn := QPushButton():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oBtn:setText( "Push Button" ) ' ) - aadd( txt_, ' oBtn:move( aPos[ 1 ],aPos[ 2 ] ) ' ) - aadd( txt_, ' oBtn:resize( aSize[ 1 ],aSize[ 2 ] ) ' ) - aadd( txt_, ' oBtn:show() ' ) - aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oBtn ), QT_EVE_CLICKED, {|| MsgInfo( "Push Button Pressed" ) } ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oGrid, oBrushBackItem0x0, oBrushForeItem0x0, oGridItem0x0 ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oGrid := QTableWidget():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oGrid:setRowCount( 2 ) ' ) - aadd( txt_, ' oGrid:setColumnCount( 4 ) ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oBrushBackItem0x0 := QBrush():new() ' ) - aadd( txt_, ' oBrushBackItem0x0:setStyle( 1 ) // Solid Color ' ) - aadd( txt_, ' oBrushBackItem0x0:setColor_1( 10 ) // http://doc.qtsoftware.com/4.5/qt.html#GlobalColor-enum ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oBrushForeItem0x0 := QBrush():new() ' ) - aadd( txt_, ' oBrushForeItem0x0:setColor_1( 7 ) ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oGridItem0x0 := QTableWidgetItem():new() ' ) - aadd( txt_, ' oGridItem0x0:setBackground( QT_PTROF( oBrushBackItem0x0 ) ) ' ) - aadd( txt_, ' oGridItem0x0:setForeground( QT_PTROF( oBrushForeItem0x0 ) ) ' ) - aadd( txt_, ' oGridItem0x0:setText( "Item 0x0" ) ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oGrid:setItem( 0, 0, QT_PTROF( oGridItem0x0 ) ) ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oGrid:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) - aadd( txt_, ' oGrid:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) - aadd( txt_, ' // ' ) - aadd( txt_, ' oGrid:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oTabWidget, oTab1, oTab2, oTab3 ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTabWidget := QTabWidget():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTab1 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) - aadd( txt_, ' oTab2 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) - aadd( txt_, ' oTab3 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab1 ), "Folders" ) ' ) - aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab2 ), "Controls" ) ' ) - aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab3 ), "TextBox" ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTabWidget:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) - aadd( txt_, ' oTabWidget:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) - aadd( txt_, ' oTabWidget:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' Build_Treeview( oTab1 ) ' ) - aadd( txt_, ' Build_Controls( oTab2 ) ' ) - aadd( txt_, ' Build_TextBox( oTab3 ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN { oTab1, oTab2, oTab3 } ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_TreeView( oWnd ) ' ) - aadd( txt_, ' LOCAL oTV, oDirModel ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTV := QTreeView():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oDirModel := QDirModel():new( QT_PTROF( oTV ) ) ' ) - aadd( txt_, ' oTV:setModel( QT_PTROF( oDirModel ) ) ' ) - aadd( txt_, ' oTV:move( 5, 7 ) ' ) - aadd( txt_, ' oTV:resize( 345, 365 ) ' ) - aadd( txt_, ' OTV:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oListBox, oStrList, oStrModel ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oListBox := QListView():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oStrList := QStringList():new( QT_PTROF( oListBox ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oStrList:append( "India" ) ' ) - aadd( txt_, ' oStrList:append( "United States" ) ' ) - aadd( txt_, ' oStrList:append( "England" ) ' ) - aadd( txt_, ' oStrList:append( "Japan" ) ' ) - aadd( txt_, ' oStrList:append( "Hungary" ) ' ) - aadd( txt_, ' oStrList:append( "Argentina" ) ' ) - aadd( txt_, ' oStrList:append( "China" ) ' ) - aadd( txt_, ' oStrList:sort() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oStrModel := QStringListModel():new( QT_PTROF( oListBox ) ) ' ) - aadd( txt_, ' oStrModel:setStringList( QT_PTROF( oStrList ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oListBox:setModel( QT_PTROF( oStrModel ) ) ' ) - aadd( txt_, ' oListBox:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) - aadd( txt_, ' oListBox:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) - aadd( txt_, ' oListBox:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_TextBox( oWnd ) ' ) - aadd( txt_, ' LOCAL oTextBox ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oTextBox := QTextEdit():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oTextBox:Move( 5, 7 ) ' ) - aadd( txt_, ' oTextBox:Resize( 345,365 ) ' ) - aadd( txt_, ' oTextBox:setAcceptRichText( .t. ) ' ) - aadd( txt_, ' oTextBox:setPlainText( "This is Harbour QT implementation" ) ' ) - aadd( txt_, ' oTextBox:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Controls( oWnd ) ' ) - aadd( txt_, ' LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton, oVariant ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oEdit := QLineEdit():new( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oEdit:move( 5, 10 ) ' ) - aadd( txt_, ' oEdit:resize( 345, 30 ) ' ) - aadd( txt_, ' oEdit:setMaxLength( 40 ) ' ) - aadd( txt_, ' oEdit:setText( "TextBox Testing Max Length = 40" ) ' ) - aadd( txt_, ' oEdit:setAlignment( 1 ) // 1: Left 2: Right 4: center 8: use all textbox length ' ) - aadd( txt_, ' oEdit:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oComboBox := QComboBox():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oComboBox:addItem( "First" ) ' ) - aadd( txt_, ' oComboBox:addItem( "Second" ) ' ) - aadd( txt_, ' oComboBox:addItem( "Third" ) ' ) - aadd( txt_, ' oComboBox:move( 5, 60 ) ' ) - aadd( txt_, ' oComboBox:resize( 345, 30 ) ' ) - aadd( txt_, ' oComboBox:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oCheckBox := QCheckBox():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oCheckBox:setText( "Testing CheckBox HbQt" ) ' ) - aadd( txt_, ' oCheckBox:move( 5, 110 ) ' ) - aadd( txt_, ' oCheckBox:resize( 345, 30 ) ' ) - aadd( txt_, ' oCheckBox:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oSpinBox := QSpinBox():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oSpinBox:Move( 5, 160 ) ' ) - aadd( txt_, ' oSpinBox:ReSize( 345, 30 ) ' ) - aadd( txt_, ' oSpinBox:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oRadioButton := QRadioButton():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oRadioButton:Move( 5, 210 ) ' ) - aadd( txt_, ' oRadioButton:ReSize( 345, 30 ) ' ) - aadd( txt_, ' oRadioButton:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_ProgressBar( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oProgressBar ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oProgressBar := QProgressBar():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oProgressBar:SetRange( 1, 1500 ) ' ) - aadd( txt_, ' oProgressBar:Setvalue( 500 ) ' ) - aadd( txt_, ' oProgressBar:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) - aadd( txt_, ' oProgressBar:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) - aadd( txt_, ' oProgressBar:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Label( oWnd, aPos, aSize ) ' ) - aadd( txt_, ' LOCAL oLabel ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oLabel := QLabel():New( QT_PTROF( oWnd ) ) ' ) - aadd( txt_, ' oLabel:SetTextFormat( 1 ) // 0 text plain 1 RichText ' ) - aadd( txt_, ' oLabel:SetText( [This is a Label in Harbour QT] ) ' ) - aadd( txt_, ' oLabel:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) - aadd( txt_, ' oLabel:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) - aadd( txt_, ' oLabel:Show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION MsgInfo( cMsg ) ' ) - aadd( txt_, ' LOCAL oMB ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oMB := QMessageBox():new() ' ) - aadd( txt_, ' oMB:setInformativeText( cMsg ) ' ) - aadd( txt_, ' oMB:setWindowTitle( "Harbour-QT" ) ' ) - aadd( txt_, ' oMB:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION FileDialog( cType, w, l ) ' ) - aadd( txt_, ' LOCAL oFD := QFileDialog():new() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oFD:setWindowTitle( "Select a File" ) ' ) - aadd( txt_, ' oFD:show() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Dialogs( cType, w, l ) ' ) - aadd( txt_, ' LOCAL oDlg, oUrl ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' DO CASE ' ) - aadd( txt_, ' CASE cType == "PageSetup" ' ) - aadd( txt_, ' oDlg := QPageSetupDialog():new() ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' CASE cType == "Preview" ' ) - aadd( txt_, ' oDlg := QPrintPreviewDialog():new() ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' CASE cType == "Wizard" ' ) - aadd( txt_, ' oDlg := QWizard():new() ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' CASE cType == "Colors" ' ) - aadd( txt_, ' oDlg := QColorDialog():new() ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' CASE cType == "WebPage" ' ) - aadd( txt_, ' oDlg := QWebView():new() ' ) - aadd( txt_, ' oUrl := QUrl():new() ' ) - aadd( txt_, ' oUrl:setUrl( "http://www.harbour.vouch.info" ) ' ) - aadd( txt_, ' QT_QWebView_SetUrl( QT_PTROF( oDlg ), QT_PTROF( oUrl ) ) ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' CASE cType == "Fonts" ' ) - aadd( txt_, ' oDlg := QFontDialog():new() ' ) - aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Font Selector" ) ' ) - aadd( txt_, ' oDlg:show() ' ) - aadd( txt_, ' ENDCASE ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#ifdef __PLATFORM__WINDOWS ' ) - aadd( txt_, 'PROCEDURE hb_GtSys() ' ) - aadd( txt_, ' HB_GT_GUI_DEFAULT() ' ) - aadd( txt_, ' RETURN ' ) - aadd( txt_, '#endif ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, '/* ' ) - aadd( txt_, ' * Just to Link Every New Widget ' ) - aadd( txt_, ' */ ' ) - aadd( txt_, 'STATIC FUNCTION Dummies() ' ) - aadd( txt_, ' LOCAL oSome ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' oSome := QAbstractButton():new() ' ) - aadd( txt_, ' oSome := QAbstractItemView():new() ' ) - aadd( txt_, ' oSome := QAbstractPrintDialog():new() ' ) - aadd( txt_, ' oSome := QAbstractScrollArea():new() ' ) - aadd( txt_, ' oSome := QAbstractSlider():new() ' ) - aadd( txt_, ' oSome := QAbstractSpinBox():new() ' ) - aadd( txt_, ' oSome := QAction():new() ' ) - aadd( txt_, ' //oSome := QApplication():new() ' ) - aadd( txt_, ' oSome := QBitmap():new() ' ) - aadd( txt_, ' oSome := QBoxLayout():new() ' ) - aadd( txt_, ' oSome := QBrush():new() ' ) - aadd( txt_, ' oSome := QCalendarWidget():new() ' ) - aadd( txt_, ' oSome := QCheckBox():new() ' ) - aadd( txt_, ' oSome := QClipboard():new() ' ) - aadd( txt_, ' oSome := QColor():new() ' ) - aadd( txt_, ' oSome := QColorDialog():new() ' ) - aadd( txt_, ' oSome := QComboBox():new() ' ) - aadd( txt_, ' oSome := QCommandLinkButton():new() ' ) - aadd( txt_, ' oSome := QCommonStyle():new() ' ) - aadd( txt_, ' oSome := QConicalGradient():new() ' ) - aadd( txt_, ' //oSome := QCoreApplication():new() ' ) - aadd( txt_, ' oSome := QDateEdit():new() ' ) - aadd( txt_, ' oSome := QDateTimeEdit():new() ' ) - aadd( txt_, ' oSome := QDesktopWidget():new() ' ) - aadd( txt_, ' oSome := QDial():new() ' ) - aadd( txt_, ' oSome := QDialog():new() ' ) - aadd( txt_, ' oSome := QDir():new() ' ) - aadd( txt_, ' oSome := QDockWidget():new() ' ) - aadd( txt_, ' oSome := QDoubleSpinBox():new() ' ) - aadd( txt_, ' oSome := QErrorMessage():new() ' ) - aadd( txt_, ' oSome := QEvent():new() ' ) - aadd( txt_, ' oSome := QEventLoop():new() ' ) - aadd( txt_, ' oSome := QFileDialog():new() ' ) - aadd( txt_, ' oSome := QFocusFrame():new() ' ) - aadd( txt_, ' oSome := QFont():new() ' ) - aadd( txt_, ' oSome := QFontComboBox():new() ' ) - aadd( txt_, ' oSome := QFontDialog():new() ' ) - aadd( txt_, ' oSome := QFontInfo():new() ' ) - aadd( txt_, ' oSome := QFormLayout():new() ' ) - aadd( txt_, ' oSome := QFrame():new() ' ) - aadd( txt_, ' oSome := QFtp():new() ' ) - aadd( txt_, ' oSome := QGradient():new() ' ) - aadd( txt_, ' oSome := QGridLayout():new() ' ) - aadd( txt_, ' oSome := QGroupBox():new() ' ) - aadd( txt_, ' oSome := QHBoxLayout():new() ' ) - aadd( txt_, ' oSome := QHeaderView():new() ' ) - aadd( txt_, ' oSome := QHttp():new() ' ) - aadd( txt_, ' oSome := QIcon():new() ' ) - aadd( txt_, ' oSome := QImage():new() ' ) - aadd( txt_, ' oSome := QImageReader():new() ' ) - aadd( txt_, ' oSome := QImageWriter():new() ' ) - aadd( txt_, ' oSome := QInputDialog():new() ' ) - aadd( txt_, ' oSome := QInputEvent():new() ' ) - aadd( txt_, ' oSome := QLabel():new() ' ) - aadd( txt_, ' oSome := QLayout():new() ' ) - aadd( txt_, ' oSome := QLayoutItem():new() ' ) - aadd( txt_, ' oSome := QLCDNumber():new() ' ) - aadd( txt_, ' oSome := QLine():new() ' ) - aadd( txt_, ' oSome := QLinearGradient():new() ' ) - aadd( txt_, ' oSome := QLineEdit():new() ' ) - aadd( txt_, ' oSome := QListView():new() ' ) - aadd( txt_, ' oSome := QListWidget():new() ' ) - aadd( txt_, ' oSome := QListWidgetItem():new() ' ) - aadd( txt_, ' oSome := QMainWindow():new() ' ) - aadd( txt_, ' oSome := QMenu():new() ' ) - aadd( txt_, ' oSome := QMenuBar():new() ' ) - aadd( txt_, ' oSome := QMessageBox():new() ' ) - aadd( txt_, ' oSome := QObject():new() ' ) - aadd( txt_, ' oSome := QPaintDevice():new() ' ) - aadd( txt_, ' oSome := QPageSetupDialog():new() ' ) - aadd( txt_, ' oSome := QPainter():new() ' ) - aadd( txt_, ' oSome := QPaintEvent():new() ' ) - aadd( txt_, ' oSome := QPalette():new() ' ) - aadd( txt_, ' oSome := QPen():new() ' ) - aadd( txt_, ' oSome := QPicture():new() ' ) - aadd( txt_, ' oSome := QPixmap():new() ' ) - aadd( txt_, ' oSome := QPoint():new() ' ) - aadd( txt_, ' oSome := QPointF():new() ' ) - aadd( txt_, ' oSome := QPrintDialog():new() ' ) - aadd( txt_, ' oSome := QPrintPreviewDialog():new() ' ) - aadd( txt_, ' oSome := QProgressBar():new() ' ) - aadd( txt_, ' oSome := QProgressDialog():new() ' ) - aadd( txt_, ' oSome := QPushButton():new() ' ) - aadd( txt_, ' oSome := QRadialGradient():new() ' ) - aadd( txt_, ' oSome := QRect():new() ' ) - aadd( txt_, ' oSome := QRectF():new() ' ) - aadd( txt_, ' oSome := QRadioButton():new() ' ) - aadd( txt_, ' oSome := QRegion():new() ' ) - aadd( txt_, ' oSome := QResource():new() ' ) - aadd( txt_, ' oSome := QScrollArea():new() ' ) - aadd( txt_, ' oSome := QScrollBar():new() ' ) - aadd( txt_, ' oSome := QSignalMapper():new() ' ) - aadd( txt_, ' oSome := QSize():new() ' ) - aadd( txt_, ' oSome := QSizeF():new() ' ) - aadd( txt_, ' oSome := QSizeGrip():new() ' ) - aadd( txt_, ' oSome := QSizePolicy():new() ' ) - aadd( txt_, ' oSome := QSlider():new() ' ) - aadd( txt_, ' oSome := QSound():new() ' ) - aadd( txt_, ' oSome := QSpinBox():new() ' ) - aadd( txt_, ' oSome := QSplashScreen():new() ' ) - aadd( txt_, ' oSome := QSplitter():new() ' ) - aadd( txt_, ' oSome := QStandardItem():new() ' ) - aadd( txt_, ' oSome := QStandardItemModel():new() ' ) - aadd( txt_, ' oSome := QStatusBar():new() ' ) - aadd( txt_, ' oSome := QStyle():new() ' ) - aadd( txt_, ' oSome := QStyledItemDelegate():new() ' ) - aadd( txt_, ' oSome := QStyleHintReturn():new() ' ) - aadd( txt_, ' oSome := QStyleHintReturnMask():new() ' ) - aadd( txt_, ' oSome := QStyleHintReturnVariant():new() ' ) - aadd( txt_, ' oSome := QStyleOption():new() ' ) - aadd( txt_, ' oSome := QStyleOptionButton():new() ' ) - aadd( txt_, ' oSome := QStyleOptionComboBox():new() ' ) - aadd( txt_, ' oSome := QStyleOptionComplex():new() ' ) - aadd( txt_, ' oSome := QStyleOptionDockWidget():new() ' ) - aadd( txt_, ' oSome := QStyleOptionFocusRect():new() ' ) - aadd( txt_, ' oSome := QStyleOptionFrame():new() ' ) - aadd( txt_, ' oSome := QStyleOptionGroupBox():new() ' ) - aadd( txt_, ' oSome := QStyleOptionHeader():new() ' ) - aadd( txt_, ' oSome := QStyleOptionMenuItem():new() ' ) - aadd( txt_, ' oSome := QStyleOptionProgressBar():new() ' ) - aadd( txt_, ' oSome := QStyleOptionSizeGrip():new() ' ) - aadd( txt_, ' oSome := QStyleOptionSlider():new() ' ) - aadd( txt_, ' oSome := QStyleOptionSpinBox():new() ' ) - aadd( txt_, ' oSome := QStyleOptionTab():new() ' ) - aadd( txt_, ' oSome := QStyleOptionTabBarBase():new() ' ) - aadd( txt_, ' oSome := QStyleOptionTabWidgetFrame():new() ' ) - aadd( txt_, ' oSome := QStyleOptionTitleBar():new() ' ) - aadd( txt_, ' oSome := QStyleOptionToolBar():new() ' ) - aadd( txt_, ' oSome := QStyleOptionToolBox():new() ' ) - aadd( txt_, ' oSome := QStyleOptionToolButton():new() ' ) - aadd( txt_, ' oSome := QStyleOptionViewItem():new() ' ) - aadd( txt_, ' oSome := QStylePainter():new() ' ) - aadd( txt_, ' oSome := QTabBar():new() ' ) - aadd( txt_, ' oSome := QTableView():new() ' ) - aadd( txt_, ' oSome := QTableWidget():new() ' ) - aadd( txt_, ' oSome := QTableWidgetItem():new() ' ) - aadd( txt_, ' oSome := QTabWidget():new() ' ) - aadd( txt_, ' oSome := QTextBlock():new() ' ) - aadd( txt_, ' oSome := QTextBlockFormat():new() ' ) - aadd( txt_, ' oSome := QTextBlockGroup():new() ' ) - aadd( txt_, ' oSome := QTextBrowser():new() ' ) - aadd( txt_, ' oSome := QTextBoundaryFinder():new() ' ) - aadd( txt_, ' oSome := QTextCharFormat():new() ' ) - aadd( txt_, ' oSome := QTextCodec():new() ' ) - aadd( txt_, ' oSome := QTextCursor():new() ' ) - aadd( txt_, ' oSome := QTextDecoder():new() ' ) - aadd( txt_, ' oSome := QTextDocument():new() ' ) - aadd( txt_, ' oSome := QTextDocumentFragment():new() ' ) - aadd( txt_, ' oSome := QTextDocumentWriter():new() ' ) - aadd( txt_, ' oSome := QTextEdit():new() ' ) - aadd( txt_, ' oSome := QTextEncoder():new() ' ) - aadd( txt_, ' oSome := QTextFormat():new() ' ) - aadd( txt_, ' oSome := QTextFragment():new() ' ) - aadd( txt_, ' oSome := QTextFrame():new() ' ) - aadd( txt_, ' oSome := QTextFrameFormat():new() ' ) - aadd( txt_, ' oSome := QTextImageFormat():new() ' ) - aadd( txt_, ' oSome := QTextInlineObject():new() ' ) - aadd( txt_, ' oSome := QTextItem():new() ' ) - aadd( txt_, ' oSome := QTextLayout():new() ' ) - aadd( txt_, ' oSome := QTextLength():new() ' ) - aadd( txt_, ' oSome := QTextLine():new() ' ) - aadd( txt_, ' oSome := QTextObject():new() ' ) - aadd( txt_, ' oSome := QTextStream():new() ' ) - aadd( txt_, ' oSome := QTimeEdit():new() ' ) - aadd( txt_, ' oSome := QTimer():new() ' ) - aadd( txt_, ' oSome := QToolBar():new() ' ) - aadd( txt_, ' oSome := QToolBox():new() ' ) - aadd( txt_, ' oSome := QToolButton():new() ' ) - aadd( txt_, ' oSome := QTreeView():new() ' ) - aadd( txt_, ' oSome := QTreeWidget():new() ' ) - aadd( txt_, ' oSome := QTreeWidgetItem():new() ' ) - aadd( txt_, ' oSome := QUrl():new() ' ) - aadd( txt_, ' oSome := QVariant():new() ' ) - aadd( txt_, ' oSome := QVBoxLayout():new() ' ) - aadd( txt_, ' oSome := QWebPage():new() ' ) - aadd( txt_, ' oSome := QWidget():new() ' ) - aadd( txt_, ' oSome := QWebView():new() ' ) - aadd( txt_, ' oSome := QWindowsStyle():new() ' ) - aadd( txt_, ' oSome := QWindowsXPStyle():new() ' ) - aadd( txt_, ' oSome := QWizard():new() ' ) - aadd( txt_, ' ' ) - aadd( txt_, ' RETURN nil ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#PRAGMA BEGINDUMP ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include ' ) - aadd( txt_, '#include "hbapi.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, 'HB_FUNC( UIDEBUG ) ' ) - aadd( txt_, '{ ' ) - aadd( txt_, ' OutputDebugString( hb_parc( 1 ) ); ' ) - aadd( txt_, '} ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#PRAGMA ENDDUMP ' ) - aadd( txt_, ' ' ) - aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aadd( txt_, ' ' ) + /* .............................................................................................................................................. */ + + aadd( txt_, '#define QT_PTROF( oObj ) ( oObj:pPtr ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#define QT_EVE_TRIGGERED "triggered()" ' ) + aadd( txt_, '#define QT_EVE_TRIGGERED_B "triggered(bool)" ' ) + aadd( txt_, '#define QT_EVE_HOVERED "hovered()" ' ) + aadd( txt_, '#define QT_EVE_CLICKED "clicked()" ' ) + aadd( txt_, '#define QT_EVE_STATECHANGED_I "stateChanged(int)" ' ) + aadd( txt_, '#define QT_EVE_PRESSED "pressed()" ' ) + aadd( txt_, '#define QT_EVE_RELEASED "released()" ' ) + aadd( txt_, '#define QT_EVE_ACTIVATED_I "activated(int)" ' ) + aadd( txt_, '#define QT_EVE_CURRENTINDEXCHANGED_I "currentIndexChanged(int)" ' ) + aadd( txt_, '#define QT_EVE_HIGHLIGHTED_I "highlighted(int)" ' ) + aadd( txt_, '#define QT_EVE_RETURNPRESSED "returnPressed()" ' ) + aadd( txt_, '#define QT_EVE_CLICKED_M "clicked(QModelIndex)" ' ) + aadd( txt_, '#define QT_EVE_VIEWPORTENTERED "viewportEntered()" ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * A NOTE ' ) + aadd( txt_, ' * ' ) + aadd( txt_, ' * This demo is built on auto generated classes by the engine. No attemp ' ) + aadd( txt_, ' * is exercised to refine the way the code must be written. At this moment ' ) + aadd( txt_, ' * my emphasis is on testing phase of QT wrapper functions and classes ' ) + aadd( txt_, ' * generated thereof. In near future the actual implementation will be ' ) + aadd( txt_, ' * based on the Xbase++ XBPParts compatible framework. You just are ' ) + aadd( txt_, ' * encouraged to sense the power of QT through this expression. ' ) + aadd( txt_, ' * ' ) + aadd( txt_, ' * Pritpal Bedi ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'INIT PROCEDURE Qt_Start() ' ) + aadd( txt_, ' qt_qapplication() ' ) + aadd( txt_, ' /*qt_qapplication_setstyle( QT_PTROF( QWindowsXPStyle():new() ) )*/ ' ) + aadd( txt_, ' RETURN ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'EXIT PROCEDURE Qt_End() ' ) + aadd( txt_, ' qt_qapplication_exec() ' ) + aadd( txt_, ' RETURN ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'PROCEDURE Main() ' ) + aadd( txt_, ' Local oLabel, oBtn, oDA, oTabBar ' ) + aadd( txt_, ' Local oWnd, oSize ' ) + aadd( txt_, ' Local oMenuBar, pIcon ' ) + aadd( txt_, ' Local oMenuA, pAction ' ) + aadd( txt_, ' LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oWnd := QMainWindow():new() ' ) + aadd( txt_, ' oWnd:setMouseTracking( .t. ) ' ) + aadd( txt_, ' oWnd:setWindowTitle( "Testing - QMainWindow, QMenu, QMenuBar and QAction " ) ' ) + aadd( txt_, ' oWnd:setWindowIcon( "test" ) ' ) + aadd( txt_, ' pIcon := oWnd:windowIcon() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* The method 2 */ ' ) + aadd( txt_, ' oWnd:resize( 900, 500 ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oDA := QWidget():new( oWnd ) ' ) + aadd( txt_, ' oWnd:setCentralWidget( QT_PTROF( oDA ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' Build_MenuBar( oWnd ) ' ) + aadd( txt_, ' Build_ToolBar( oWnd ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oSBar := QStatusBar():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oWnd:setStatusBar( QT_PTROF( oSBar ) ) ' ) + aadd( txt_, ' oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStyle := QWindowsXPStyle() ' ) + aadd( txt_, ' oStyle:standardIcon( 2 ) ' ) + aadd( txt_, ' oWnd:setStyle( QT_PTROF( oStyle ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' Build_Label( oDA, { 30,190 }, { 300, 30 } ) ' ) + aadd( txt_, ' Build_PushButton( oDA, { 30,240 }, { 100,50 } ) ' ) + aadd( txt_, ' Build_Grid( oDA, { 30, 30 }, { 450,150 } ) ' ) + aadd( txt_, ' Build_Tabs( oDA, { 510, 5 }, { 360, 400 } ) ' ) + aadd( txt_, ' Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) ' ) + aadd( txt_, ' Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oWnd:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_MenuBar( oWnd ) ' ) + aadd( txt_, ' LOCAL oMenuBar, oMenu ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oMenuBar := QMenuBar():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oMenuBar:resize( oWnd:width(), 25 ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' ) + aadd( txt_, ' oMenu:setTitle( "&File" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } ) ' ) + aadd( txt_, ' oMenu:addSeparator() ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Save" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save", w, l ) } ) ' ) + aadd( txt_, ' oMenu:addSeparator() ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| MsgInfo( "Exit ?" ) } ) ' ) + aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' ) + aadd( txt_, ' oMenu:setTitle( "&Dialogs" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) ' ) + aadd( txt_, ' oMenu:addSeparator() ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&PageSetup" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "P&review" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview" , w, l ) } ) ' ) + aadd( txt_, ' oMenu:addSeparator() ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Wizard" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard" , w, l ) } ) ' ) + aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "W&ebPage" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage" , w, l ) } ) ' ) + aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oWnd:setMenuBar( QT_PTROF( oMenuBar ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_ToolBar( oWnd ) ' ) + aadd( txt_, ' LOCAL oTB, oAct ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Create a Toolbar Object */ ' ) + aadd( txt_, ' oTB := QToolBar():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Create an action */ ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&New" ) ' ) + aadd( txt_, ' oAct:setIcon( "new.png" ) ' ) + aadd( txt_, ' oAct:setToolTip( "A New File" ) ' ) + aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) ' ) + aadd( txt_, ' /* Attach Action with Toolbar */ ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Create another action */ ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Open" ) ' ) + aadd( txt_, ' oAct:setIcon( "open.png" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Select a file to be opened!" ) ' ) + aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open" , w, l ) } ) ' ) + aadd( txt_, ' /* Attach Action with Toolbar */ ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTB:addSeparator() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Create another action */ ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Save" ) ' ) + aadd( txt_, ' oAct:setIcon( "save.png" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Save this file!" ) ' ) + aadd( txt_, ' /* Attach codeblock to be triggered */ ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save" , w, l ) } ) ' ) + aadd( txt_, ' /* Attach Action with Toolbar */ ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Add this toolbar with main window */ ' ) + aadd( txt_, ' oWnd:addToolBar_1( QT_PTROF( oTB ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /////////////////////////////////////////////////////////// ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Build another toolbar - we will have two toolbats now */ ' ) + aadd( txt_, ' oTB := QToolBar():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Colors" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Colors Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Fonts" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Fonts Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTB:addSeparator() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&PgSetup" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Page Setup Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Preview" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Page Preview Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTB:addSeparator() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Webpage" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Web Browser Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oAct := QAction():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oAct:setText( "&Wizard" ) ' ) + aadd( txt_, ' oAct:setToolTip( "Generic Wizard Dialog" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oAct ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard", w, l ) } ) ' ) + aadd( txt_, ' oTB:addAction( QT_PTROF( oAct ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' /* Add this toolbar with main window */ ' ) + aadd( txt_, ' oWnd:addToolBar_1( QT_PTROF( oTB ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oBtn ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oBtn := QPushButton():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oBtn:setText( "Push Button" ) ' ) + aadd( txt_, ' oBtn:move( aPos[ 1 ],aPos[ 2 ] ) ' ) + aadd( txt_, ' oBtn:resize( aSize[ 1 ],aSize[ 2 ] ) ' ) + aadd( txt_, ' oBtn:show() ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oBtn ), QT_EVE_CLICKED, {|| MsgInfo( "Push Button Pressed" ) } ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oGrid, oBrushBackItem0x0, oBrushForeItem0x0, oGridItem0x0 ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oGrid := QTableWidget():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oGrid:setRowCount( 2 ) ' ) + aadd( txt_, ' oGrid:setColumnCount( 4 ) ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oBrushBackItem0x0 := QBrush():new() ' ) + aadd( txt_, ' oBrushBackItem0x0:setStyle( 1 ) // Solid Color ' ) + aadd( txt_, ' oBrushBackItem0x0:setColor_1( 10 ) // http://doc.qtsoftware.com/4.5/qt.html#GlobalColor-enum ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oBrushForeItem0x0 := QBrush():new() ' ) + aadd( txt_, ' oBrushForeItem0x0:setColor_1( 7 ) ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oGridItem0x0 := QTableWidgetItem():new() ' ) + aadd( txt_, ' oGridItem0x0:setBackground( QT_PTROF( oBrushBackItem0x0 ) ) ' ) + aadd( txt_, ' oGridItem0x0:setForeground( QT_PTROF( oBrushForeItem0x0 ) ) ' ) + aadd( txt_, ' oGridItem0x0:setText( "Item 0x0" ) ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oGrid:setItem( 0, 0, QT_PTROF( oGridItem0x0 ) ) ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oGrid:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oGrid:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' // ' ) + aadd( txt_, ' oGrid:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oTabWidget, oTab1, oTab2, oTab3 ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTabWidget := QTabWidget():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTab1 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) + aadd( txt_, ' oTab2 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) + aadd( txt_, ' oTab3 := QWidget():new( QT_PTROF( oTabWidget ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab1 ), "Folders" ) ' ) + aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab2 ), "Controls" ) ' ) + aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab3 ), "TextBox" ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTabWidget:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oTabWidget:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' oTabWidget:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' Build_Treeview( oTab1 ) ' ) + aadd( txt_, ' Build_Controls( oTab2 ) ' ) + aadd( txt_, ' Build_TextBox( oTab3 ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN { oTab1, oTab2, oTab3 } ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_TreeView( oWnd ) ' ) + aadd( txt_, ' LOCAL oTV, oDirModel ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTV := QTreeView():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oTV:setMouseTracking( .t. ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oTV ), QT_EVE_HOVERED, {|o,i| uiDebug( "oTV:hovered" ) } ) ' ) + aadd( txt_, ' oDirModel := QDirModel():new( QT_PTROF( oTV ) ) ' ) + aadd( txt_, ' oTV:setModel( QT_PTROF( oDirModel ) ) ' ) + aadd( txt_, ' oTV:move( 5, 7 ) ' ) + aadd( txt_, ' oTV:resize( 345, 365 ) ' ) + aadd( txt_, ' OTV:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oListBox, oStrList, oStrModel, oAct ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oListBox := QListView():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oListBox:setMouseTracking( .t. ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oListBox ), QT_EVE_HOVERED, {|o,i| uiDebug( "oListBox:hovered" ) } ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrList := QStringList():new( QT_PTROF( oListBox ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrList:append( "India" ) ' ) + aadd( txt_, ' oStrList:append( "United States" ) ' ) + aadd( txt_, ' oStrList:append( "England" ) ' ) + aadd( txt_, ' oStrList:append( "Japan" ) ' ) + aadd( txt_, ' oStrList:append( "Hungary" ) ' ) + aadd( txt_, ' oStrList:append( "Argentina" ) ' ) + aadd( txt_, ' oStrList:append( "China" ) ' ) + aadd( txt_, ' oStrList:sort() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrModel := QStringListModel():new( QT_PTROF( oListBox ) ) ' ) + aadd( txt_, ' oStrModel:setStringList( QT_PTROF( oStrList ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oListBox:setModel( QT_PTROF( oStrModel ) ) ' ) + aadd( txt_, ' oListBox:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oListBox:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' oListBox:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_TextBox( oWnd ) ' ) + aadd( txt_, ' LOCAL oTextBox ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oTextBox := QTextEdit():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oTextBox:Move( 5, 7 ) ' ) + aadd( txt_, ' oTextBox:Resize( 345,365 ) ' ) + aadd( txt_, ' oTextBox:setAcceptRichText( .t. ) ' ) + aadd( txt_, ' oTextBox:setPlainText( "This is Harbour QT implementation" ) ' ) + aadd( txt_, ' oTextBox:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_Controls( oWnd ) ' ) + aadd( txt_, ' LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton, oVariant ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oEdit := QLineEdit():new( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oEdit ), QT_EVE_RETURNPRESSED, {|o,i| MsgInfo( oEdit:text() ) } ) ' ) + aadd( txt_, ' oEdit:move( 5, 10 ) ' ) + aadd( txt_, ' oEdit:resize( 345, 30 ) ' ) + aadd( txt_, ' oEdit:setMaxLength( 40 ) ' ) + aadd( txt_, ' oEdit:setText( "TextBox Testing Max Length = 40" ) ' ) + aadd( txt_, ' oEdit:setAlignment( 1 ) // 1: Left 2: Right 4: center 8: use all textbox length ' ) + aadd( txt_, ' oEdit:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oComboBox := QComboBox():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oComboBox:addItem( "First" ) ' ) + aadd( txt_, ' oComboBox:addItem( "Second" ) ' ) + aadd( txt_, ' oComboBox:addItem( "Third" ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oComboBox ), QT_EVE_HIGHLIGHTED_I , {|o,i| uiDebug( oComboBox:itemText( i ) ) } ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oComboBox ), QT_EVE_CURRENTINDEXCHANGED_I, {|o,i| MsgInfo( oComboBox:itemText( i ) ) } ) ' ) + aadd( txt_, ' oComboBox:move( 5, 60 ) ' ) + aadd( txt_, ' oComboBox:resize( 345, 30 ) ' ) + aadd( txt_, ' oComboBox:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oCheckBox := QCheckBox():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oCheckBox ), QT_EVE_STATECHANGED_I, {|o,i| MsgInfo( IF( i == 0,"Uncheckd","Checked" ) ) } ) ' ) + aadd( txt_, ' oCheckBox:setText( "Testing CheckBox HbQt" ) ' ) + aadd( txt_, ' oCheckBox:move( 5, 110 ) ' ) + aadd( txt_, ' oCheckBox:resize( 345, 30 ) ' ) + aadd( txt_, ' oCheckBox:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oSpinBox := QSpinBox():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oSpinBox:Move( 5, 160 ) ' ) + aadd( txt_, ' oSpinBox:ReSize( 345, 30 ) ' ) + aadd( txt_, ' oSpinBox:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oRadioButton := QRadioButton():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' Qt_Connect_Signal( QT_PTROF( oRadioButton ), QT_EVE_CLICKED, {|o,i| MsgInfo( "Checked" ) } ) ' ) + aadd( txt_, ' oRadioButton:Move( 5, 210 ) ' ) + aadd( txt_, ' oRadioButton:ReSize( 345, 30 ) ' ) + aadd( txt_, ' oRadioButton:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_ProgressBar( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oProgressBar ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oProgressBar := QProgressBar():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oProgressBar:SetRange( 1, 1500 ) ' ) + aadd( txt_, ' oProgressBar:Setvalue( 500 ) ' ) + aadd( txt_, ' oProgressBar:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oProgressBar:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' oProgressBar:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_Label( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oLabel ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oLabel := QLabel():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' oLabel:SetTextFormat( 1 ) // 0 text plain 1 RichText ' ) + aadd( txt_, ' oLabel:SetText( [This is a Label in Harbour QT] ) ' ) + aadd( txt_, ' oLabel:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oLabel:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' oLabel:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION MsgInfo( cMsg ) ' ) + aadd( txt_, ' LOCAL oMB ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oMB := QMessageBox():new() ' ) + aadd( txt_, ' oMB:setInformativeText( cMsg ) ' ) + aadd( txt_, ' oMB:setWindowTitle( "Harbour-QT" ) ' ) + aadd( txt_, ' oMB:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION FileDialog( cType, w, l ) ' ) + aadd( txt_, ' LOCAL oFD := QFileDialog():new() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oFD:setWindowTitle( "Select a File" ) ' ) + aadd( txt_, ' oFD:show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Dialogs( cType, w, l ) ' ) + aadd( txt_, ' LOCAL oDlg, oUrl ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' DO CASE ' ) + aadd( txt_, ' CASE cType == "PageSetup" ' ) + aadd( txt_, ' oDlg := QPageSetupDialog():new() ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' CASE cType == "Preview" ' ) + aadd( txt_, ' oDlg := QPrintPreviewDialog():new() ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' CASE cType == "Wizard" ' ) + aadd( txt_, ' oDlg := QWizard():new() ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' CASE cType == "Colors" ' ) + aadd( txt_, ' oDlg := QColorDialog():new() ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' CASE cType == "WebPage" ' ) + aadd( txt_, ' oDlg := QWebView():new() ' ) + aadd( txt_, ' oUrl := QUrl():new() ' ) + aadd( txt_, ' oUrl:setUrl( "http://www.harbour.vouch.info" ) ' ) + aadd( txt_, ' QT_QWebView_SetUrl( QT_PTROF( oDlg ), QT_PTROF( oUrl ) ) ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' CASE cType == "Fonts" ' ) + aadd( txt_, ' oDlg := QFontDialog():new() ' ) + aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Font Selector" ) ' ) + aadd( txt_, ' oDlg:show() ' ) + aadd( txt_, ' ENDCASE ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#ifdef __PLATFORM__WINDOWS ' ) + aadd( txt_, 'PROCEDURE hb_GtSys() ' ) + aadd( txt_, ' HB_GT_GUI_DEFAULT() ' ) + aadd( txt_, ' RETURN ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, '/* ' ) + aadd( txt_, ' * Just to Link Every New Widget ' ) + aadd( txt_, ' */ ' ) + aadd( txt_, 'STATIC FUNCTION Dummies() ' ) + aadd( txt_, ' LOCAL oSome ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oSome := QAbstractButton():new() ' ) + aadd( txt_, ' oSome := QAbstractItemView():new() ' ) + aadd( txt_, ' oSome := QAbstractPrintDialog():new() ' ) + aadd( txt_, ' oSome := QAbstractScrollArea():new() ' ) + aadd( txt_, ' oSome := QAbstractSlider():new() ' ) + aadd( txt_, ' oSome := QAbstractSpinBox():new() ' ) + aadd( txt_, ' oSome := QAction():new() ' ) + aadd( txt_, ' //oSome := QApplication():new() ' ) + aadd( txt_, ' oSome := QBitmap():new() ' ) + aadd( txt_, ' oSome := QBoxLayout():new() ' ) + aadd( txt_, ' oSome := QBrush():new() ' ) + aadd( txt_, ' oSome := QCalendarWidget():new() ' ) + aadd( txt_, ' oSome := QCheckBox():new() ' ) + aadd( txt_, ' oSome := QClipboard():new() ' ) + aadd( txt_, ' oSome := QColor():new() ' ) + aadd( txt_, ' oSome := QColorDialog():new() ' ) + aadd( txt_, ' oSome := QComboBox():new() ' ) + aadd( txt_, ' oSome := QCommandLinkButton():new() ' ) + aadd( txt_, ' oSome := QCommonStyle():new() ' ) + aadd( txt_, ' oSome := QConicalGradient():new() ' ) + aadd( txt_, ' //oSome := QCoreApplication():new() ' ) + aadd( txt_, ' oSome := QDateEdit():new() ' ) + aadd( txt_, ' oSome := QDateTimeEdit():new() ' ) + aadd( txt_, ' oSome := QDesktopWidget():new() ' ) + aadd( txt_, ' oSome := QDial():new() ' ) + aadd( txt_, ' oSome := QDialog():new() ' ) + aadd( txt_, ' oSome := QDir():new() ' ) + aadd( txt_, ' oSome := QDockWidget():new() ' ) + aadd( txt_, ' oSome := QDoubleSpinBox():new() ' ) + aadd( txt_, ' oSome := QErrorMessage():new() ' ) + aadd( txt_, ' oSome := QEvent():new() ' ) + aadd( txt_, ' oSome := QEventLoop():new() ' ) + aadd( txt_, ' oSome := QFileDialog():new() ' ) + aadd( txt_, ' oSome := QFocusFrame():new() ' ) + aadd( txt_, ' oSome := QFont():new() ' ) + aadd( txt_, ' oSome := QFontComboBox():new() ' ) + aadd( txt_, ' oSome := QFontDialog():new() ' ) + aadd( txt_, ' oSome := QFontInfo():new() ' ) + aadd( txt_, ' oSome := QFormLayout():new() ' ) + aadd( txt_, ' oSome := QFrame():new() ' ) + aadd( txt_, ' oSome := QFtp():new() ' ) + aadd( txt_, ' oSome := QGradient():new() ' ) + aadd( txt_, ' oSome := QGridLayout():new() ' ) + aadd( txt_, ' oSome := QGroupBox():new() ' ) + aadd( txt_, ' oSome := QHBoxLayout():new() ' ) + aadd( txt_, ' oSome := QHeaderView():new() ' ) + aadd( txt_, ' oSome := QHttp():new() ' ) + aadd( txt_, ' oSome := QIcon():new() ' ) + aadd( txt_, ' oSome := QImage():new() ' ) + aadd( txt_, ' oSome := QImageReader():new() ' ) + aadd( txt_, ' oSome := QImageWriter():new() ' ) + aadd( txt_, ' oSome := QInputDialog():new() ' ) + aadd( txt_, ' oSome := QInputEvent():new() ' ) + aadd( txt_, ' oSome := QLabel():new() ' ) + aadd( txt_, ' oSome := QLayout():new() ' ) + aadd( txt_, ' oSome := QLayoutItem():new() ' ) + aadd( txt_, ' oSome := QLCDNumber():new() ' ) + aadd( txt_, ' oSome := QLine():new() ' ) + aadd( txt_, ' oSome := QLinearGradient():new() ' ) + aadd( txt_, ' oSome := QLineEdit():new() ' ) + aadd( txt_, ' oSome := QListView():new() ' ) + aadd( txt_, ' oSome := QListWidget():new() ' ) + aadd( txt_, ' oSome := QListWidgetItem():new() ' ) + aadd( txt_, ' oSome := QMainWindow():new() ' ) + aadd( txt_, ' oSome := QMenu():new() ' ) + aadd( txt_, ' oSome := QMenuBar():new() ' ) + aadd( txt_, ' oSome := QMessageBox():new() ' ) + aadd( txt_, ' oSome := QObject():new() ' ) + aadd( txt_, ' oSome := QPaintDevice():new() ' ) + aadd( txt_, ' oSome := QPageSetupDialog():new() ' ) + aadd( txt_, ' oSome := QPainter():new() ' ) + aadd( txt_, ' oSome := QPaintEvent():new() ' ) + aadd( txt_, ' oSome := QPalette():new() ' ) + aadd( txt_, ' oSome := QPen():new() ' ) + aadd( txt_, ' oSome := QPicture():new() ' ) + aadd( txt_, ' oSome := QPixmap():new() ' ) + aadd( txt_, ' oSome := QPoint():new() ' ) + aadd( txt_, ' oSome := QPointF():new() ' ) + aadd( txt_, ' oSome := QPrintDialog():new() ' ) + aadd( txt_, ' oSome := QPrintPreviewDialog():new() ' ) + aadd( txt_, ' oSome := QProgressBar():new() ' ) + aadd( txt_, ' oSome := QProgressDialog():new() ' ) + aadd( txt_, ' oSome := QPushButton():new() ' ) + aadd( txt_, ' oSome := QRadialGradient():new() ' ) + aadd( txt_, ' oSome := QRect():new() ' ) + aadd( txt_, ' oSome := QRectF():new() ' ) + aadd( txt_, ' oSome := QRadioButton():new() ' ) + aadd( txt_, ' oSome := QRegion():new() ' ) + aadd( txt_, ' oSome := QResource():new() ' ) + aadd( txt_, ' oSome := QScrollArea():new() ' ) + aadd( txt_, ' oSome := QScrollBar():new() ' ) + aadd( txt_, ' oSome := QSignalMapper():new() ' ) + aadd( txt_, ' oSome := QSize():new() ' ) + aadd( txt_, ' oSome := QSizeF():new() ' ) + aadd( txt_, ' oSome := QSizeGrip():new() ' ) + aadd( txt_, ' oSome := QSizePolicy():new() ' ) + aadd( txt_, ' oSome := QSlider():new() ' ) + aadd( txt_, ' oSome := QSound():new() ' ) + aadd( txt_, ' oSome := QSpinBox():new() ' ) + aadd( txt_, ' oSome := QSplashScreen():new() ' ) + aadd( txt_, ' oSome := QSplitter():new() ' ) + aadd( txt_, ' oSome := QStandardItem():new() ' ) + aadd( txt_, ' oSome := QStandardItemModel():new() ' ) + aadd( txt_, ' oSome := QStatusBar():new() ' ) + aadd( txt_, ' oSome := QStyle():new() ' ) + aadd( txt_, ' oSome := QStyledItemDelegate():new() ' ) + aadd( txt_, ' oSome := QStyleHintReturn():new() ' ) + aadd( txt_, ' oSome := QStyleHintReturnMask():new() ' ) + aadd( txt_, ' oSome := QStyleHintReturnVariant():new() ' ) + aadd( txt_, ' oSome := QStyleOption():new() ' ) + aadd( txt_, ' oSome := QStyleOptionButton():new() ' ) + aadd( txt_, ' oSome := QStyleOptionComboBox():new() ' ) + aadd( txt_, ' oSome := QStyleOptionComplex():new() ' ) + aadd( txt_, ' oSome := QStyleOptionDockWidget():new() ' ) + aadd( txt_, ' oSome := QStyleOptionFocusRect():new() ' ) + aadd( txt_, ' oSome := QStyleOptionFrame():new() ' ) + aadd( txt_, ' oSome := QStyleOptionGroupBox():new() ' ) + aadd( txt_, ' oSome := QStyleOptionHeader():new() ' ) + aadd( txt_, ' oSome := QStyleOptionMenuItem():new() ' ) + aadd( txt_, ' oSome := QStyleOptionProgressBar():new() ' ) + aadd( txt_, ' oSome := QStyleOptionSizeGrip():new() ' ) + aadd( txt_, ' oSome := QStyleOptionSlider():new() ' ) + aadd( txt_, ' oSome := QStyleOptionSpinBox():new() ' ) + aadd( txt_, ' oSome := QStyleOptionTab():new() ' ) + aadd( txt_, ' oSome := QStyleOptionTabBarBase():new() ' ) + aadd( txt_, ' oSome := QStyleOptionTabWidgetFrame():new() ' ) + aadd( txt_, ' oSome := QStyleOptionTitleBar():new() ' ) + aadd( txt_, ' oSome := QStyleOptionToolBar():new() ' ) + aadd( txt_, ' oSome := QStyleOptionToolBox():new() ' ) + aadd( txt_, ' oSome := QStyleOptionToolButton():new() ' ) + aadd( txt_, ' oSome := QStyleOptionViewItem():new() ' ) + aadd( txt_, ' oSome := QStylePainter():new() ' ) + aadd( txt_, ' oSome := QTabBar():new() ' ) + aadd( txt_, ' oSome := QTableView():new() ' ) + aadd( txt_, ' oSome := QTableWidget():new() ' ) + aadd( txt_, ' oSome := QTableWidgetItem():new() ' ) + aadd( txt_, ' oSome := QTabWidget():new() ' ) + aadd( txt_, ' oSome := QTextBlock():new() ' ) + aadd( txt_, ' oSome := QTextBlockFormat():new() ' ) + aadd( txt_, ' oSome := QTextBlockGroup():new() ' ) + aadd( txt_, ' oSome := QTextBrowser():new() ' ) + aadd( txt_, ' oSome := QTextBoundaryFinder():new() ' ) + aadd( txt_, ' oSome := QTextCharFormat():new() ' ) + aadd( txt_, ' oSome := QTextCodec():new() ' ) + aadd( txt_, ' oSome := QTextCursor():new() ' ) + aadd( txt_, ' oSome := QTextDecoder():new() ' ) + aadd( txt_, ' oSome := QTextDocument():new() ' ) + aadd( txt_, ' oSome := QTextDocumentFragment():new() ' ) + aadd( txt_, ' oSome := QTextDocumentWriter():new() ' ) + aadd( txt_, ' oSome := QTextEdit():new() ' ) + aadd( txt_, ' oSome := QTextEncoder():new() ' ) + aadd( txt_, ' oSome := QTextFormat():new() ' ) + aadd( txt_, ' oSome := QTextFragment():new() ' ) + aadd( txt_, ' oSome := QTextFrame():new() ' ) + aadd( txt_, ' oSome := QTextFrameFormat():new() ' ) + aadd( txt_, ' oSome := QTextImageFormat():new() ' ) + aadd( txt_, ' oSome := QTextInlineObject():new() ' ) + aadd( txt_, ' oSome := QTextItem():new() ' ) + aadd( txt_, ' oSome := QTextLayout():new() ' ) + aadd( txt_, ' oSome := QTextLength():new() ' ) + aadd( txt_, ' oSome := QTextLine():new() ' ) + aadd( txt_, ' oSome := QTextObject():new() ' ) + aadd( txt_, ' oSome := QTextStream():new() ' ) + aadd( txt_, ' oSome := QTimeEdit():new() ' ) + aadd( txt_, ' oSome := QTimer():new() ' ) + aadd( txt_, ' oSome := QToolBar():new() ' ) + aadd( txt_, ' oSome := QToolBox():new() ' ) + aadd( txt_, ' oSome := QToolButton():new() ' ) + aadd( txt_, ' oSome := QTreeView():new() ' ) + aadd( txt_, ' oSome := QTreeWidget():new() ' ) + aadd( txt_, ' oSome := QTreeWidgetItem():new() ' ) + aadd( txt_, ' oSome := QUrl():new() ' ) + aadd( txt_, ' oSome := QVariant():new() ' ) + aadd( txt_, ' oSome := QVBoxLayout():new() ' ) + aadd( txt_, ' oSome := QWebPage():new() ' ) + aadd( txt_, ' oSome := QWidget():new() ' ) + aadd( txt_, ' oSome := QWebView():new() ' ) + aadd( txt_, ' oSome := QWindowsStyle():new() ' ) + aadd( txt_, ' oSome := QWindowsXPStyle():new() ' ) + aadd( txt_, ' oSome := QWizard():new() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#PRAGMA BEGINDUMP ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include "hbapi.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'HB_FUNC( UIDEBUG ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' OutputDebugString( hb_parc( 1 ) ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#PRAGMA ENDDUMP ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + + /* .............................................................................................................................................. */ RETURN CreateTarget( cFile, txt_ ) diff --git a/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp b/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp index 6b17b1b6ea..fb782bdd43 100644 --- a/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp @@ -103,7 +103,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_CANFETCHMORE ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_COLUMNCOUNT ) { - hb_retni( hbqt_par_QAbstractItemModel( 1 )->columnCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retni( hbqt_par_QAbstractItemModel( 1 )->columnCount( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* @@ -143,7 +143,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_FLAGS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_HASCHILDREN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasChildren( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasChildren( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* @@ -151,7 +151,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_HASCHILDREN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_HASINDEX ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasIndex( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasIndex( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -167,7 +167,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_HEADERDATA ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INDEX ) { - hb_retptr( new QModelIndex( hbqt_par_QAbstractItemModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); + hb_retptr( new QModelIndex( hbqt_par_QAbstractItemModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ) ); } /* @@ -175,7 +175,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INDEX ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* @@ -183,7 +183,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMNS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -191,7 +191,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMNS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROW ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* @@ -199,7 +199,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROW ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROWS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -231,7 +231,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_PARENT ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumn( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* @@ -239,7 +239,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMNS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -247,7 +247,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMNS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROW ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRow( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* @@ -255,7 +255,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROW ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROWS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -263,7 +263,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROWS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_ROWCOUNT ) { - hb_retni( hbqt_par_QAbstractItemModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retni( hbqt_par_QAbstractItemModel( 1 )->rowCount( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp b/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp index 6bed078578..4a39778b84 100644 --- a/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp @@ -77,7 +77,7 @@ HB_FUNC( QT_QABSTRACTLISTMODEL ) */ HB_FUNC( QT_QABSTRACTLISTMODEL_INDEX ) { - hb_retptr( new QModelIndex( hbqt_par_QAbstractListModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); + hb_retptr( new QModelIndex( hbqt_par_QAbstractListModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ) ); } diff --git a/harbour/contrib/hbqt/hbqt_qcombobox.cpp b/harbour/contrib/hbqt/hbqt_qcombobox.cpp index 5fb78ae48c..0a1d24d8fa 100644 --- a/harbour/contrib/hbqt/hbqt_qcombobox.cpp +++ b/harbour/contrib/hbqt/hbqt_qcombobox.cpp @@ -77,7 +77,7 @@ HB_FUNC( QT_QCOMBOBOX ) */ HB_FUNC( QT_QCOMBOBOX_ADDITEM ) { - hbqt_par_QComboBox( 1 )->addItem( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QVariant() : *hbqt_par_QVariant( 3 ) ) ); + hbqt_par_QComboBox( 1 )->addItem( hbqt_par_QString( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QVariant( 3 ) : QVariant() ) ); } /* @@ -85,7 +85,7 @@ HB_FUNC( QT_QCOMBOBOX_ADDITEM ) */ HB_FUNC( QT_QCOMBOBOX_ADDITEM_1 ) { - hbqt_par_QComboBox( 1 )->addItem( QIcon( hbqt_par_QString( 2 ) ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QVariant() : *hbqt_par_QVariant( 4 ) ) ); + hbqt_par_QComboBox( 1 )->addItem( QIcon( hbqt_par_QString( 2 ) ), hbqt_par_QString( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QVariant( 4 ) : QVariant() ) ); } /* @@ -181,7 +181,7 @@ HB_FUNC( QT_QCOMBOBOX_ICONSIZE ) */ HB_FUNC( QT_QCOMBOBOX_INSERTITEM ) { - hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QVariant() : *hbqt_par_QVariant( 4 ) ) ); + hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), hbqt_par_QString( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QVariant( 4 ) : QVariant() ) ); } /* @@ -189,7 +189,7 @@ HB_FUNC( QT_QCOMBOBOX_INSERTITEM ) */ HB_FUNC( QT_QCOMBOBOX_INSERTITEM_1 ) { - hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ), hbqt_par_QString( 4 ), ( HB_ISNIL( 5 ) ? QVariant() : *hbqt_par_QVariant( 5 ) ) ); + hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ), hbqt_par_QString( 4 ), ( HB_ISPOINTER( 5 ) ? *hbqt_par_QVariant( 5 ) : QVariant() ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qdirmodel.cpp b/harbour/contrib/hbqt/hbqt_qdirmodel.cpp index c950c689f4..993cc808b0 100644 --- a/harbour/contrib/hbqt/hbqt_qdirmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qdirmodel.cpp @@ -78,7 +78,7 @@ HB_FUNC( QT_QDIRMODEL ) */ HB_FUNC( QT_QDIRMODEL_COLUMNCOUNT ) { - hb_retni( hbqt_par_QDirModel( 1 )->columnCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retni( hbqt_par_QDirModel( 1 )->columnCount( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* @@ -150,7 +150,7 @@ HB_FUNC( QT_QDIRMODEL_FLAGS ) */ HB_FUNC( QT_QDIRMODEL_HASCHILDREN ) { - hb_retl( hbqt_par_QDirModel( 1 )->hasChildren( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retl( hbqt_par_QDirModel( 1 )->hasChildren( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* @@ -174,7 +174,7 @@ HB_FUNC( QT_QDIRMODEL_ICONPROVIDER ) */ HB_FUNC( QT_QDIRMODEL_INDEX ) { - hb_retptr( new QModelIndex( hbqt_par_QDirModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); + hb_retptr( new QModelIndex( hbqt_par_QDirModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ) ); } /* @@ -278,7 +278,7 @@ HB_FUNC( QT_QDIRMODEL_RMDIR ) */ HB_FUNC( QT_QDIRMODEL_ROWCOUNT ) { - hb_retni( hbqt_par_QDirModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retni( hbqt_par_QDirModel( 1 )->rowCount( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* @@ -374,7 +374,7 @@ HB_FUNC( QT_QDIRMODEL_SUPPORTEDDROPACTIONS ) */ HB_FUNC( QT_QDIRMODEL_REFRESH ) { - hbqt_par_QDirModel( 1 )->refresh( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ); + hbqt_par_QDirModel( 1 )->refresh( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ); } diff --git a/harbour/contrib/hbqt/hbqt_qicon.cpp b/harbour/contrib/hbqt/hbqt_qicon.cpp index 3cbd8bd102..21416d1219 100644 --- a/harbour/contrib/hbqt/hbqt_qicon.cpp +++ b/harbour/contrib/hbqt/hbqt_qicon.cpp @@ -99,7 +99,7 @@ HB_FUNC( QT_QICON_ACTUALSIZE ) */ HB_FUNC( QT_QICON_ADDFILE ) { - hbqt_par_QIcon( 1 )->addFile( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QSize() : *hbqt_par_QSize( 3 ) ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ); + hbqt_par_QIcon( 1 )->addFile( hbqt_par_QString( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QSize( 3 ) : QSize() ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qimage.cpp b/harbour/contrib/hbqt/hbqt_qimage.cpp index 27770fbc19..af14f74219 100644 --- a/harbour/contrib/hbqt/hbqt_qimage.cpp +++ b/harbour/contrib/hbqt/hbqt_qimage.cpp @@ -162,7 +162,7 @@ HB_FUNC( QT_QIMAGE_CONVERTTOFORMAT ) */ HB_FUNC( QT_QIMAGE_COPY ) { - hb_retptr( new QImage( hbqt_par_QImage( 1 )->copy( ( HB_ISNIL( 2 ) ? QRect() : *hbqt_par_QRect( 2 ) ) ) ) ); + hb_retptr( new QImage( hbqt_par_QImage( 1 )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qpainter.cpp b/harbour/contrib/hbqt/hbqt_qpainter.cpp index a8c99f0ef5..d5de9efc38 100644 --- a/harbour/contrib/hbqt/hbqt_qpainter.cpp +++ b/harbour/contrib/hbqt/hbqt_qpainter.cpp @@ -146,7 +146,7 @@ HB_FUNC( QT_QPAINTER_BOUNDINGRECT_2 ) */ HB_FUNC( QT_QPAINTER_BOUNDINGRECT_3 ) { - hb_retptr( new QRectF( hbqt_par_QPainter( 1 )->boundingRect( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QTextOption() : *hbqt_par_QTextOption( 4 ) ) ) ) ); + hb_retptr( new QRectF( hbqt_par_QPainter( 1 )->boundingRect( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) ) ) ); } /* @@ -874,7 +874,7 @@ HB_FUNC( QT_QPAINTER_DRAWTEXT_5 ) */ HB_FUNC( QT_QPAINTER_DRAWTEXT_6 ) { - hbqt_par_QPainter( 1 )->drawText( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QTextOption() : *hbqt_par_QTextOption( 4 ) ) ); + hbqt_par_QPainter( 1 )->drawText( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) ); } /* @@ -882,7 +882,7 @@ HB_FUNC( QT_QPAINTER_DRAWTEXT_6 ) */ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP ) { - hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISNIL( 4 ) ? QPointF() : *hbqt_par_QPointF( 4 ) ) ); + hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QPointF( 4 ) : QPointF() ) ); } /* @@ -890,7 +890,7 @@ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP ) */ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP_1 ) { - hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISNIL( 4 ) ? QPoint() : *hbqt_par_QPoint( 4 ) ) ); + hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QPoint( 4 ) : QPoint() ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qpixmap.cpp b/harbour/contrib/hbqt/hbqt_qpixmap.cpp index 6478788c6e..3a3a52c741 100644 --- a/harbour/contrib/hbqt/hbqt_qpixmap.cpp +++ b/harbour/contrib/hbqt/hbqt_qpixmap.cpp @@ -98,7 +98,7 @@ HB_FUNC( QT_QPIXMAP_CACHEKEY ) */ HB_FUNC( QT_QPIXMAP_COPY ) { - hb_retptr( new QPixmap( hbqt_par_QPixmap( 1 )->copy( ( HB_ISNIL( 2 ) ? QRect() : *hbqt_par_QRect( 2 ) ) ) ) ); + hb_retptr( new QPixmap( hbqt_par_QPixmap( 1 )->copy( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QRect( 2 ) : QRect() ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp b/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp index 787a21b25f..d591d9b0a0 100644 --- a/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp @@ -125,7 +125,7 @@ HB_FUNC( QT_QSTANDARDITEMMODEL_INDEXFROMITEM ) */ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTCOLUMN ) { - hb_retl( hbqt_par_QStandardItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QStandardItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* @@ -133,7 +133,7 @@ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTCOLUMN ) */ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTROW ) { - hb_retl( hbqt_par_QStandardItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); + hb_retl( hbqt_par_QStandardItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QModelIndex( 3 ) : QModelIndex() ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp b/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp index fc76963f38..f28a171b64 100644 --- a/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp @@ -93,7 +93,7 @@ HB_FUNC( QT_QSTRINGLISTMODEL_FLAGS ) */ HB_FUNC( QT_QSTRINGLISTMODEL_INSERTROWS ) { - hb_retl( hbqt_par_QStringListModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QStringListModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -101,7 +101,7 @@ HB_FUNC( QT_QSTRINGLISTMODEL_INSERTROWS ) */ HB_FUNC( QT_QSTRINGLISTMODEL_REMOVEROWS ) { - hb_retl( hbqt_par_QStringListModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retl( hbqt_par_QStringListModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QModelIndex( 4 ) : QModelIndex() ) ) ); } /* @@ -109,7 +109,7 @@ HB_FUNC( QT_QSTRINGLISTMODEL_REMOVEROWS ) */ HB_FUNC( QT_QSTRINGLISTMODEL_ROWCOUNT ) { - hb_retni( hbqt_par_QStringListModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); + hb_retni( hbqt_par_QStringListModel( 1 )->rowCount( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QModelIndex( 2 ) : QModelIndex() ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qtextdocument.cpp b/harbour/contrib/hbqt/hbqt_qtextdocument.cpp index 423f5ffaba..073431e1e4 100644 --- a/harbour/contrib/hbqt/hbqt_qtextdocument.cpp +++ b/harbour/contrib/hbqt/hbqt_qtextdocument.cpp @@ -183,7 +183,7 @@ HB_FUNC( QT_QTEXTDOCUMENT_DOCUMENTMARGIN ) */ HB_FUNC( QT_QTEXTDOCUMENT_DRAWCONTENTS ) { - hbqt_par_QTextDocument( 1 )->drawContents( hbqt_par_QPainter( 2 ), ( HB_ISNIL( 3 ) ? QRectF() : *hbqt_par_QRectF( 3 ) ) ); + hbqt_par_QTextDocument( 1 )->drawContents( hbqt_par_QPainter( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QRectF( 3 ) : QRectF() ) ); } /* @@ -559,7 +559,7 @@ HB_FUNC( QT_QTEXTDOCUMENT_TEXTWIDTH ) */ HB_FUNC( QT_QTEXTDOCUMENT_TOHTML ) { - hb_retc( hbqt_par_QTextDocument( 1 )->toHtml( ( HB_ISNIL( 2 ) ? QByteArray() : *hbqt_par_QByteArray( 2 ) ) ).toLatin1().data() ); + hb_retc( hbqt_par_QTextDocument( 1 )->toHtml( ( HB_ISPOINTER( 2 ) ? *hbqt_par_QByteArray( 2 ) : QByteArray() ) ).toLatin1().data() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qwebview.cpp b/harbour/contrib/hbqt/hbqt_qwebview.cpp index a22586eea9..aef08300d2 100644 --- a/harbour/contrib/hbqt/hbqt_qwebview.cpp +++ b/harbour/contrib/hbqt/hbqt_qwebview.cpp @@ -118,7 +118,7 @@ HB_FUNC( QT_QWEBVIEW_LOAD ) */ HB_FUNC( QT_QWEBVIEW_LOAD_1 ) { - hbqt_par_QWebView( 1 )->load( *hbqt_par_QNetworkRequest( 2 ), ( HB_ISNUM( 3 ) ? ( QNetworkAccessManager::Operation ) hb_parni( 3 ) : ( QNetworkAccessManager::Operation ) QNetworkAccessManager::GetOperation ), ( HB_ISNIL( 4 ) ? QByteArray() : *hbqt_par_QByteArray( 4 ) ) ); + hbqt_par_QWebView( 1 )->load( *hbqt_par_QNetworkRequest( 2 ), ( HB_ISNUM( 3 ) ? ( QNetworkAccessManager::Operation ) hb_parni( 3 ) : ( QNetworkAccessManager::Operation ) QNetworkAccessManager::GetOperation ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QByteArray( 4 ) : QByteArray() ) ); } /* @@ -150,7 +150,7 @@ HB_FUNC( QT_QWEBVIEW_SELECTEDTEXT ) */ HB_FUNC( QT_QWEBVIEW_SETCONTENT ) { - hbqt_par_QWebView( 1 )->setContent( *hbqt_par_QByteArray( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QUrl() : *hbqt_par_QUrl( 4 ) ) ); + hbqt_par_QWebView( 1 )->setContent( *hbqt_par_QByteArray( 2 ), hbqt_par_QString( 3 ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QUrl( 4 ) : QUrl() ) ); } /* @@ -158,7 +158,7 @@ HB_FUNC( QT_QWEBVIEW_SETCONTENT ) */ HB_FUNC( QT_QWEBVIEW_SETHTML ) { - hbqt_par_QWebView( 1 )->setHtml( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QUrl() : *hbqt_par_QUrl( 3 ) ) ); + hbqt_par_QWebView( 1 )->setHtml( hbqt_par_QString( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QUrl( 3 ) : QUrl() ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_slots.cpp b/harbour/contrib/hbqt/hbqt_slots.cpp index 555a978830..2c865cf8db 100644 --- a/harbour/contrib/hbqt/hbqt_slots.cpp +++ b/harbour/contrib/hbqt/hbqt_slots.cpp @@ -94,11 +94,34 @@ static void SlotsExec( QWidget* widget, QString event, PHB_ITEM pItem ) } } } - if( pItem != NULL ) + { hb_itemRelease( pItem ); + } } +static void SlotsExecInt( QWidget* widget, QString event, PHB_ITEM pItem, int iValue ) +{ + for( int i = 0; i < s->list1.size(); ++i ) + { + if( ( QWidget* ) s->list1.at( i ) == widget ) + { + if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) + { + PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); + PHB_ITEM pState = hb_itemPutNI( NULL, iValue ); + + hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 2, pWidget, pState ); + hb_itemRelease( pWidget ); + hb_itemRelease( pState ); + } + } + } + if( pItem != NULL ) + { + hb_itemRelease( pItem ); + } +} Slots::Slots( QObject* parent ) : QObject( parent ) { @@ -111,42 +134,43 @@ Slots::~Slots() void Slots::clicked() { QWidget *widget = qobject_cast( sender() ); - SlotsExec( widget, ( QString ) "clicked()", NULL ); +} - #if 0 - for( int i = 0; i < list1.size(); ++i ) - { - if( ( QWidget* ) list1.at( i ) == ( QWidget* ) widget ) - { - if( ( ( QString ) list2.at( i ) == ( QString ) "clicked()" ) && ( ( bool ) list4.at( i ) == true ) ) - { - PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); +void Slots::returnPressed() +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "returnPressed()", NULL ); +} - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); - hb_itemRelease( pWidget ); - } - } - } - #endif +void Slots::viewportEntered() +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "viewportEntered()", NULL ); +} + +void Slots::pressed() +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "pressed()", NULL ); +} + +void Slots::released() +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "released()", NULL ); +} + +void Slots::hovered() +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "hovered()", NULL ); } void Slots::triggered() { - QObject *widget = qobject_cast( sender() ); - for( int i = 0; i < list1.size(); ++i ) - { - if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) - { - if( ( ( QString ) list2.at( i ) == ( QString ) "triggered()" ) && ( ( bool ) list4.at( i ) == true ) ) - { - PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); - - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); - hb_itemRelease( pWidget ); - } - } - } + QWidget *widget = qobject_cast( sender() ); + SlotsExec( widget, ( QString ) "triggered()", NULL ); } void Slots::triggered( bool checked ) @@ -169,36 +193,43 @@ void Slots::triggered( bool checked ) } } -void Slots::hovered() +void Slots::stateChanged( int state ) { - QObject *widget = qobject_cast( sender() ); - for( int i = 0; i < list1.size(); ++i ) - { - if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) - { - if( ( ( QString ) list2.at( i ) == ( QString ) "hovered()" ) && ( ( bool ) list4.at( i ) == true ) ) - { - PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject * ) widget ); - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); - hb_itemRelease( pWidget ); - } - } - } + QWidget *widget = qobject_cast( sender() ); + SlotsExecInt( widget, ( QString ) "stateChanged(int)", NULL, state ); } -void Slots::stateChanged( int state ) +void Slots::activated( int index ) +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExecInt( widget, ( QString ) "activated(int)", NULL, index ); +} + +void Slots::currentIndexChanged( int index ) +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExecInt( widget, ( QString ) "currentIndexChanged(int)", NULL, index ); +} + +void Slots::highlighted( int index ) +{ + QWidget *widget = qobject_cast( sender() ); + SlotsExecInt( widget, ( QString ) "highlighted(int)", NULL, index ); +} + +void Slots::clicked_model( const QModelIndex & index ) { QWidget * widget = qobject_cast( sender() ); for( int i = 0; i < list1.size(); ++i ) { if( ( QWidget * ) list1.at( i ) == ( QWidget * ) widget ) { - if( ( ( QString ) list2.at( i ) == ( QString ) "stateChanged(int)" ) && ( ( bool ) list4.at( i ) == true ) ) + if( ( ( QString ) list2.at( i ) == ( QString ) "clicked(QModelIndex)" ) && ( ( bool ) list4.at( i ) == true ) ) { PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); - PHB_ITEM pState = hb_itemPutNI( NULL, state ); + PHB_ITEM pState = hb_itemPutPtr( NULL, ( QModelIndex * ) new QModelIndex( index ) ); - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pState ); + hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget, pState ); hb_itemRelease( pWidget ); hb_itemRelease( pState ); } @@ -206,36 +237,141 @@ void Slots::stateChanged( int state ) } } -void Slots::pressed() +/* + * harbour function to connect signals with slots + */ +HB_FUNC( QT_CONNECT_SIGNAL ) { - QWidget * widget = qobject_cast(sender()); - for( int i = 0; i < list1.size(); ++i ) + QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ + QString signal = hb_parc( 2 ); /* get signal */ + PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ + bool ret = false; /* return value */ + + /* create object s, if not created yet */ + if( s == NULL ) + s = new Slots(); + + /* connect signal with slot + * if the list become to long, more classes can be created + * TODO: parameter Qt::AutoConnection + */ + + /* Events with no parameters */ + if( signal == ( QString ) "clicked()" ) { - if( ( QWidget * ) list1.at( i ) == ( QWidget * ) widget ) + ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "returnPressed()" ) + { + ret = widget->connect( widget, SIGNAL( returnPressed() ) , s, SLOT( returnPressed() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "triggered()" ) + { + ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "hovered()" ) + { + ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "viewportEntered()" ) + { + ret = widget->connect( widget, SIGNAL( viewportEntered() ), s, SLOT( viewportEntered() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "pressed()" ) + { + ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "released()" ) + { + ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); + } + /* Events with int parameter */ + if( signal == ( QString ) "stateChanged(int)" ) + { + ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); + } + if( signal == ( QString ) "activated(int)" ) + { + ret = widget->connect( widget, SIGNAL( activated( int ) ) , s, SLOT( activated( int ) ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "currentIndexChanged(int)" ) + { + ret = widget->connect( widget, SIGNAL( currentIndexChanged( int ) ), s, SLOT( currentIndexChanged( int ) ), Qt::AutoConnection ); + } + if( signal == ( QString ) "highlighted(int)" ) + { + ret = widget->connect( widget, SIGNAL( highlighted( int ) ) , s, SLOT( highlighted( int ) ) , Qt::AutoConnection ); + } + /* Events with bool parameter */ + if( signal == ( QString ) "triggered(bool)" ) + { + ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); + } + /* Events with miscellaneous parameters */ + if( signal == ( QString ) "clicked(QModelIndex)" ) + { + ret = widget->connect( widget, SIGNAL( clicked_model( const QModelIndex & ) ), s, SLOT( clicked( const QModelIndex & ) ) , Qt::AutoConnection ); + } + + /* return connect result */ + hb_retl( ret ); + + /* if connected: store widget, signal, codeblock and flag + * TODO: locate a inactive entry and use it + */ + if( ret == true ) + { + s->list1 << widget; + s->list2 << signal; + s->list3 << codeblock; + s->list4 << true; + } +} + + +/* + * harbour function to disconnect signals + */ +HB_FUNC( QT_DISCONNECT_SIGNAL ) +{ + /* TODO */ +} + + +/* + * harbour function to release all codeblocks storeds + */ +#if 0 +HB_FUNC( RELEASE_CODEBLOCKS ) +{ + if( s ) + { + for( int i = 0; i < s->list1.size(); ++i ) { - if( ( ( QString ) list2.at( i ) == ( QString ) "pressed()" ) && ( ( bool ) list4.at( i ) == true ) ) + if( ( bool ) s->list4.at( i ) == true ) { - PHB_ITEM pWidget = hb_itemPutPtr( NULL, (QWidget *) widget ); - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); - hb_itemRelease( pWidget ); + hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); } } } } +#endif -void Slots::released() + +/* + * C function to release all codeblocks storeds + * called at end of the program + * see qapplication.cpp + */ +void release_codeblocks( void ) { - QWidget* widget = qobject_cast( sender() ); - - for( int i = 0; i < list1.size(); ++i ) + if( s ) { - if( ( QWidget* ) list1.at( i ) == ( QWidget* ) widget ) + for( int i = 0; i < s->list1.size(); ++i ) { - if( ( ( QString ) list2.at( i ) == ( QString ) "released()" ) && ( ( bool ) list4.at( i ) == true ) ) + if( ( bool ) s->list4.at( i ) == true ) { - PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); - hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 1, pWidget ); - hb_itemRelease( pWidget ); + hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); } } } @@ -254,9 +390,9 @@ HB_FUNC( QT_CONNECT_SIGNAL_1 ) s = new Slots(); /* connect signal with slot - // if the list become to long, more classes can be created - // TODO: parameter Qt::AutoConnection - */ + * if the list become to long, more classes can be created + * TODO: parameter Qt::AutoConnection + */ switch( signal ) { case HBQT_EVT_CLICKED: @@ -282,11 +418,12 @@ HB_FUNC( QT_CONNECT_SIGNAL_1 ) break; } - // return connect result + /* return connect result */ hb_retl( ret ); - // if connected: store widget, signal, codeblock and flag - // TODO: locate a inactive entry and use it + /* if connected: store widget, signal, codeblock and flag + * TODO: locate a inactive entry and use it + */ if( ret == true ) { s->list1 << widget; @@ -297,116 +434,7 @@ HB_FUNC( QT_CONNECT_SIGNAL_1 ) } #endif -/* -harbour function to connect signals with slots -*/ -HB_FUNC( QT_CONNECT_SIGNAL ) -{ - QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ - QString signal = hb_parc( 2 ); /* get signal */ - PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ - bool ret = false; /* return value */ - - /* create object s, if not created yet */ - if( s == NULL ) - s = new Slots(); - - /* connect signal with slot - // if the list become to long, more classes can be created - // TODO: parameter Qt::AutoConnection - */ - if( signal == ( QString ) "clicked()" ) - { - ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); - } - if( signal == ( QString ) "triggered()" ) - { - ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); - } - if( signal == ( QString ) "triggered(bool)" ) - { - ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); - } - if( signal == ( QString ) "hovered()" ) - { - ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); - } - if( signal == ( QString ) "stateChanged(int)" ) - { - ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); - } - if( signal == ( QString ) "pressed()" ) - { - ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); - } - if( signal == ( QString ) "released()" ) - { - ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); - } - - // return connect result - hb_retl( ret ); - - // if connected: store widget, signal, codeblock and flag - // TODO: locate a inactive entry and use it - if( ret == true ) - { - s->list1 << widget; - s->list2 << signal; - s->list3 << codeblock; - s->list4 << true; - } -} - - -/* -harbour function to disconnect signals -*/ -HB_FUNC( QT_DISCONNECT_SIGNAL ) -{ - /* TODO */ -} - - -/* -harbour function to release all codeblocks storeds -*/ -#if 0 -HB_FUNC( RELEASE_CODEBLOCKS ) -{ - if( s ) - { - for( int i = 0; i < s->list1.size(); ++i ) - { - if( ( bool ) s->list4.at( i ) == true ) - { - hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); - } - } - } -} -#endif - - -/* -C function to release all codeblocks storeds -called at end of the program -see qapplication.cpp -*/ -void release_codeblocks( void ) -{ - if( s ) - { - for( int i = 0; i < s->list1.size(); ++i ) - { - if( ( bool ) s->list4.at( i ) == true ) - { - hb_itemRelease( ( PHB_ITEM ) s->list3.at( i ) ); - } - } - } -} - /*----------------------------------------------------------------------*/ #endif + diff --git a/harbour/contrib/hbqt/hbqt_slots.h b/harbour/contrib/hbqt/hbqt_slots.h index ef7598a014..88da7522d3 100644 --- a/harbour/contrib/hbqt/hbqt_slots.h +++ b/harbour/contrib/hbqt/hbqt_slots.h @@ -59,6 +59,7 @@ #include #include +#include #include "hbapi.h" #include "hbapiitm.h" @@ -83,6 +84,12 @@ class Slots: public QObject void stateChanged( int state ); void pressed(); void released(); + void activated( int index ); + void currentIndexChanged( int index ); + void highlighted( int index ); + void returnPressed(); + void clicked_model( const QModelIndex & index ); + void viewportEntered(); }; #endif diff --git a/harbour/contrib/hbqt/moc_slots.cpp b/harbour/contrib/hbqt/moc_slots.cpp index 8e578ff7c9..9770ac973e 100644 --- a/harbour/contrib/hbqt/moc_slots.cpp +++ b/harbour/contrib/hbqt/moc_slots.cpp @@ -1,20 +1,15 @@ /**************************************************************************** -** Meta object code from reading C++ file "slots.h" +** Meta object code from reading C++ file hbqt_slots.h ** -** Created: Wed 18. Mar 17:25:39 2009 +** Created: Sun Jun 7 21:29:21 2009 ** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#include "hbqt.h" - - -#if QT_VERSION >= 0x040500 - #include "hbqt_slots.h" #if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file [slots.h] doesn,t include ." +#error "The header file hbqt_slots.h doesnt include ." #elif Q_MOC_OUTPUT_REVISION != 61 #error "This file was generated using the moc from 4.5.0. It" #error "cannot be used with the include files from this version of Qt." @@ -28,7 +23,7 @@ static const uint qt_meta_data_Slots[] = { 2, // revision 0, // classname 0, 0, // classinfo - 7, 12, // methods + 13, 12, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -41,6 +36,12 @@ static const uint qt_meta_data_Slots[] = { 69, 63, 6, 6, 0x0a, 87, 6, 6, 6, 0x0a, 97, 6, 6, 6, 0x0a, + 114, 108, 6, 6, 0x0a, + 129, 108, 6, 6, 0x0a, + 154, 108, 6, 6, 0x0a, + 171, 6, 6, 6, 0x0a, + 187, 108, 6, 6, 0x0a, + 214, 6, 6, 6, 0x0a, 0 // eod }; @@ -49,6 +50,9 @@ static const char qt_meta_stringdata_Slots[] = { "Slots\0\0clicked()\0triggered()\0checked\0" "triggered(bool)\0hovered()\0state\0" "stateChanged(int)\0pressed()\0released()\0" + "index\0activated(int)\0currentIndexChanged(int)\0" + "highlighted(int)\0returnPressed()\0" + "clicked_model(QModelIndex)\0viewportEntered()\0" }; const QMetaObject Slots::staticMetaObject = { @@ -83,14 +87,17 @@ int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) case 4: stateChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 5: pressed(); break; case 6: released(); break; + case 7: activated((*reinterpret_cast< int(*)>(_a[1]))); break; + case 8: currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 9: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break; + case 10: returnPressed(); break; + case 11: clicked_model((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; + case 12: viewportEntered(); break; default: ; } - _id -= 7; + _id -= 13; } return _id; } QT_END_MOC_NAMESPACE - -#endif - diff --git a/harbour/contrib/hbqt/tests/demoqt.prg b/harbour/contrib/hbqt/tests/demoqt.prg index e5e885550f..897c6c4aa4 100644 --- a/harbour/contrib/hbqt/tests/demoqt.prg +++ b/harbour/contrib/hbqt/tests/demoqt.prg @@ -54,10 +54,19 @@ #define QT_PTROF( oObj ) ( oObj:pPtr ) -#define QT_EVE_TRIGGERED "triggered(bool)" -#define QT_EVE_TRIGGERED_B "triggered(bool)" -#define QT_EVE_HOVERED "hovered()" -#define QT_EVE_CLICKED "clicked()" +#define QT_EVE_TRIGGERED "triggered()" +#define QT_EVE_TRIGGERED_B "triggered(bool)" +#define QT_EVE_HOVERED "hovered()" +#define QT_EVE_CLICKED "clicked()" +#define QT_EVE_STATECHANGED_I "stateChanged(int)" +#define QT_EVE_PRESSED "pressed()" +#define QT_EVE_RELEASED "released()" +#define QT_EVE_ACTIVATED_I "activated(int)" +#define QT_EVE_CURRENTINDEXCHANGED_I "currentIndexChanged(int)" +#define QT_EVE_HIGHLIGHTED_I "highlighted(int)" +#define QT_EVE_RETURNPRESSED "returnPressed()" +#define QT_EVE_CLICKED_M "clicked(QModelIndex)" +#define QT_EVE_VIEWPORTENTERED "viewportEntered()" /*----------------------------------------------------------------------*/ /* @@ -93,6 +102,7 @@ PROCEDURE Main() LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle oWnd := QMainWindow():new() + oWnd:setMouseTracking( .t. ) oWnd:setWindowTitle( "Testing - QMainWindow, QMenu, QMenuBar and QAction " ) oWnd:setWindowIcon( "test" ) pIcon := oWnd:windowIcon() @@ -327,7 +337,8 @@ STATIC FUNCTION Build_TreeView( oWnd ) LOCAL oTV, oDirModel oTV := QTreeView():new( QT_PTROF( oWnd ) ) - + oTV:setMouseTracking( .t. ) + Qt_Connect_Signal( QT_PTROF( oTV ), QT_EVE_HOVERED, {|o,i| uiDebug( "oTV:hovered" ) } ) oDirModel := QDirModel():new( QT_PTROF( oTV ) ) oTV:setModel( QT_PTROF( oDirModel ) ) oTV:move( 5, 7 ) @@ -339,9 +350,11 @@ STATIC FUNCTION Build_TreeView( oWnd ) /*----------------------------------------------------------------------*/ STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) - LOCAL oListBox, oStrList, oStrModel + LOCAL oListBox, oStrList, oStrModel, oAct oListBox := QListView():New( QT_PTROF( oWnd ) ) + oListBox:setMouseTracking( .t. ) + Qt_Connect_Signal( QT_PTROF( oListBox ), QT_EVE_HOVERED, {|o,i| uiDebug( "oListBox:hovered" ) } ) oStrList := QStringList():new( QT_PTROF( oListBox ) ) @@ -384,6 +397,7 @@ STATIC FUNCTION Build_Controls( oWnd ) LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton, oVariant oEdit := QLineEdit():new( QT_PTROF( oWnd ) ) + Qt_Connect_Signal( QT_PTROF( oEdit ), QT_EVE_RETURNPRESSED, {|o,i| MsgInfo( oEdit:text() ) } ) oEdit:move( 5, 10 ) oEdit:resize( 345, 30 ) oEdit:setMaxLength( 40 ) @@ -392,15 +406,17 @@ STATIC FUNCTION Build_Controls( oWnd ) oEdit:show() oComboBox := QComboBox():New( QT_PTROF( oWnd ) ) - oComboBox:addItem( "First" ) oComboBox:addItem( "Second" ) oComboBox:addItem( "Third" ) + Qt_Connect_Signal( QT_PTROF( oComboBox ), QT_EVE_HIGHLIGHTED_I , {|o,i| uiDebug( oComboBox:itemText( i ) ) } ) + Qt_Connect_Signal( QT_PTROF( oComboBox ), QT_EVE_CURRENTINDEXCHANGED_I, {|o,i| MsgInfo( oComboBox:itemText( i ) ) } ) oComboBox:move( 5, 60 ) oComboBox:resize( 345, 30 ) oComboBox:show() oCheckBox := QCheckBox():New( QT_PTROF( oWnd ) ) + Qt_Connect_Signal( QT_PTROF( oCheckBox ), QT_EVE_STATECHANGED_I, {|o,i| MsgInfo( IF( i == 0,"Uncheckd","Checked" ) ) } ) oCheckBox:setText( "Testing CheckBox HbQt" ) oCheckBox:move( 5, 110 ) oCheckBox:resize( 345, 30 ) @@ -412,6 +428,7 @@ STATIC FUNCTION Build_Controls( oWnd ) oSpinBox:Show() oRadioButton := QRadioButton():New( QT_PTROF( oWnd ) ) + Qt_Connect_Signal( QT_PTROF( oRadioButton ), QT_EVE_CLICKED, {|o,i| MsgInfo( "Checked" ) } ) oRadioButton:Move( 5, 210 ) oRadioButton:ReSize( 345, 30 ) oRadioButton:Show() @@ -718,3 +735,4 @@ HB_FUNC( UIDEBUG ) #PRAGMA ENDDUMP /*----------------------------------------------------------------------*/ +