diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a388af6c8b..330b488b6a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,26 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-11 00:34 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/hbqtgen.prg + * harbour/contrib/hbqt/generator/qt45.qtp + * harbour/contrib/hbqt/hbqt.h + + + harbour/contrib/hbqt/hbqt_qkeyevent.cpp + + harbour/contrib/hbqt/hbqt_qmouseevent.cpp + + * harbour/contrib/hbqt/hbqt_slots.cpp + * harbour/contrib/hbqt/hbqt_slots.h + * harbour/contrib/hbqt/Makefile_gen + * harbour/contrib/hbqt/moc_slots.cpp + + + harbour/contrib/hbqt/qth/QKeyEvent.qth + + harbour/contrib/hbqt/qth/QMouseEvent.qth + + harbour/contrib/hbqt/TQKeyEvent.prg + + harbour/contrib/hbqt/TQMouseEvent.prg + + Added two more classes. + + Added more event handlers. + 2009-06-11 08:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * Stripped "\devl" from all examples dirs. diff --git a/harbour/contrib/hbqt/Makefile_gen b/harbour/contrib/hbqt/Makefile_gen index 2beeab58cf..80fb5cf03a 100644 --- a/harbour/contrib/hbqt/Makefile_gen +++ b/harbour/contrib/hbqt/Makefile_gen @@ -62,6 +62,7 @@ CPP_SOURCES=\ hbqt_qimagewriter.cpp \ hbqt_qinputdialog.cpp \ hbqt_qinputevent.cpp \ + hbqt_qkeyevent.cpp \ hbqt_qlabel.cpp \ hbqt_qlayout.cpp \ hbqt_qlayoutitem.cpp \ @@ -78,6 +79,7 @@ CPP_SOURCES=\ hbqt_qmenubar.cpp \ hbqt_qmessagebox.cpp \ hbqt_qmodelindex.cpp \ + hbqt_qmouseevent.cpp \ hbqt_qobject.cpp \ hbqt_qpaintdevice.cpp \ hbqt_qpagesetupdialog.cpp \ @@ -264,6 +266,7 @@ PRG_SOURCES=\ TQImageWriter.prg \ TQInputDialog.prg \ TQInputEvent.prg \ + TQKeyEvent.prg \ TQLabel.prg \ TQLayout.prg \ TQLayoutItem.prg \ @@ -280,6 +283,7 @@ PRG_SOURCES=\ TQMenuBar.prg \ TQMessageBox.prg \ TQModelIndex.prg \ + TQMouseEvent.prg \ TQObject.prg \ TQPaintDevice.prg \ TQPageSetupDialog.prg \ diff --git a/harbour/contrib/hbqt/TQKeyEvent.prg b/harbour/contrib/hbqt/TQKeyEvent.prg new file mode 100644 index 0000000000..ca17ab284f --- /dev/null +++ b/harbour/contrib/hbqt/TQKeyEvent.prg @@ -0,0 +1,89 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QKeyEvent INHERIT QInputEvent + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD count() INLINE Qt_QKeyEvent_count( ::pPtr ) + METHOD isAutoRepeat() INLINE Qt_QKeyEvent_isAutoRepeat( ::pPtr ) + METHOD key() INLINE Qt_QKeyEvent_key( ::pPtr ) + METHOD matches( nKey ) INLINE Qt_QKeyEvent_matches( ::pPtr, nKey ) + METHOD modifiers() INLINE Qt_QKeyEvent_modifiers( ::pPtr ) + METHOD nativeModifiers() INLINE Qt_QKeyEvent_nativeModifiers( ::pPtr ) + METHOD nativeScanCode() INLINE Qt_QKeyEvent_nativeScanCode( ::pPtr ) + METHOD nativeVirtualKey() INLINE Qt_QKeyEvent_nativeVirtualKey( ::pPtr ) + METHOD text() INLINE Qt_QKeyEvent_text( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QKeyEvent + + ::pParent := pParent + + ::pPtr := Qt_QKeyEvent( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQMouseEvent.prg b/harbour/contrib/hbqt/TQMouseEvent.prg new file mode 100644 index 0000000000..92ff537d9d --- /dev/null +++ b/harbour/contrib/hbqt/TQMouseEvent.prg @@ -0,0 +1,89 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QMouseEvent INHERIT QInputEvent + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD button() INLINE Qt_QMouseEvent_button( ::pPtr ) + METHOD buttons() INLINE Qt_QMouseEvent_buttons( ::pPtr ) + METHOD globalPos() INLINE Qt_QMouseEvent_globalPos( ::pPtr ) + METHOD globalX() INLINE Qt_QMouseEvent_globalX( ::pPtr ) + METHOD globalY() INLINE Qt_QMouseEvent_globalY( ::pPtr ) + METHOD pos() INLINE Qt_QMouseEvent_pos( ::pPtr ) + METHOD posF() INLINE Qt_QMouseEvent_posF( ::pPtr ) + METHOD x() INLINE Qt_QMouseEvent_x( ::pPtr ) + METHOD y() INLINE Qt_QMouseEvent_y( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QMouseEvent + + ::pParent := pParent + + ::pPtr := Qt_QMouseEvent( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index ba6e793b45..61024b1dfd 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -1567,8 +1567,10 @@ STATIC FUNCTION Build_HBQT_H( cPathOut ) aadd( txt_, "#define hbqt_par_QList( n ) ( ( QList* ) hb_parptr( n ) ) " ) aadd( txt_, "#define hbqt_par_QStringListModel( n ) ( ( QStringListModel* ) hb_parptr( n ) ) " ) aadd( txt_, "#define hbqt_par_QAbstractListModel( n ) ( ( QAbstractListModel* ) hb_parptr( n ) ) " ) - aadd( txt_, "#define hbqt_par_QAbstractTableModel( n ) ( ( QAbstractTableModel* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QAbstractTableModel( n ) ( ( QAbstractTableModel* ) hb_parptr( n ) ) " ) aadd( txt_, "#define hbqt_par_QFileSystemModel( n ) ( ( QFileSystemModel* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QKeyEvent( n ) ( ( QKeyEvent* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QMouseEvent( n ) ( ( QMouseEvent* ) hb_parptr( n ) ) " ) aadd( txt_, " " ) aadd( txt_, "#define hbqt_par_QString( n ) ( ( QString ) hb_parc( n ) ) " ) aadd( txt_, "#define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) " ) @@ -1822,8 +1824,13 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut ) aadd( txt_, '#define SLOTS_H ' ) aadd( txt_, ' ' ) aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) aadd( txt_, '#include ' ) aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, ' ' ) aadd( txt_, ' ' ) aadd( txt_, '#include "hbapi.h" ' ) aadd( txt_, '#include "hbapiitm.h" ' ) @@ -1832,7 +1839,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut ) aadd( txt_, '{ ' ) aadd( txt_, ' Q_OBJECT ' ) aadd( txt_, ' ' ) - aadd( txt_, ' public: ' ) + aadd( txt_, 'public: ' ) aadd( txt_, ' Slots( QObject *parent = 0 ); ' ) aadd( txt_, ' ~Slots(); ' ) aadd( txt_, ' QList list1; ' ) @@ -1840,7 +1847,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut ) aadd( txt_, ' QList list3; ' ) aadd( txt_, ' QList list4; ' ) aadd( txt_, ' ' ) - aadd( txt_, ' public slots: ' ) + aadd( txt_, 'public slots: ' ) aadd( txt_, ' void clicked(); ' ) aadd( txt_, ' void triggered(); ' ) aadd( txt_, ' void triggered( bool checked ); ' ) @@ -1854,11 +1861,91 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut ) aadd( txt_, ' void returnPressed(); ' ) aadd( txt_, ' void clicked_model( const QModelIndex & index ); ' ) aadd( txt_, ' void viewportEntered(); ' ) + aadd( txt_, ' bool event( QEvent *event ); ' ) + aadd( txt_, ' void keyPressEvent( QKeyEvent * event ); ' ) + aadd( txt_, ' void mouseMoveEvent( QMouseEvent * event ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#if 0 ' ) + aadd( txt_, ' void accessibleEvent(); ' ) + aadd( txt_, ' void actionEvent(); ' ) + aadd( txt_, ' void childEvent(); ' ) + aadd( txt_, ' void closeEvent(); ' ) + aadd( txt_, ' void customEvent(); ' ) + aadd( txt_, ' void dragLeaveEvent(); ' ) + aadd( txt_, ' void dropEvent(); ' ) + aadd( txt_, ' void dynamicPropertyChangeEvent(); ' ) + aadd( txt_, ' void fileOpenEvent(); ' ) + aadd( txt_, ' void focusEvent(); ' ) + aadd( txt_, ' void graphicsSceneEvent(); ' ) + aadd( txt_, ' void helpEvent(); ' ) + aadd( txt_, ' void hideEvent(); ' ) + aadd( txt_, ' void hoverEvent(); ' ) + aadd( txt_, ' void iconDragEvent(); ' ) + aadd( txt_, ' void inputEvent(); ' ) + aadd( txt_, ' void inputMethodEvent(); ' ) + aadd( txt_, ' void moveEvent(); ' ) + aadd( txt_, ' void paintEvent(); ' ) + aadd( txt_, ' void resizeEvent(); ' ) + aadd( txt_, ' void shortcutEvent(); ' ) + aadd( txt_, ' void showEvent(); ' ) + aadd( txt_, ' void statusTipEvent(); ' ) + aadd( txt_, ' void timerEvent(); ' ) + aadd( txt_, ' void whatsThisClickedEvent(); ' ) + aadd( txt_, ' void windowStateChangeEvent(); ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'class MyDrawingArea : public QWidget ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' Q_OBJECT ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'public: ' ) + aadd( txt_, ' MyDrawingArea( QWidget *parent = 0 ); ' ) + aadd( txt_, ' virtual ~MyDrawingArea( void ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' #if 0 ' ) + aadd( txt_, 'protected slots: ' ) + aadd( txt_, ' void keyReleaseEvent( QKeyEvent * event ); ' ) + aadd( txt_, ' void mousePressEvent( QMouseEvent * event ); ' ) + aadd( txt_, ' void mouseReleaseEvent( QMouseEvent * event ); ' ) + aadd( txt_, ' void mouseDoubleClickEvent( QMouseEvent * event );' ) + aadd( txt_, ' void paintEvent( QPaintEvent * event ); ' ) + aadd( txt_, ' void resizeEvent( QResizeEvent * event ); ' ) + aadd( txt_, ' void wheelEvent( QWheelEvent * event ); ' ) + aadd( txt_, ' void timerEvent( QTimerEvent * event ); ' ) + aadd( txt_, ' void focusInEvent( QFocusEvent * event ); ' ) + aadd( txt_, ' void focusOutEvent( QFocusEvent * event ); ' ) + aadd( txt_, ' void moveEvent( QMoveEvent * event ); ' ) + aadd( txt_, ' bool event( QEvent * event ); ' ) + aadd( txt_, ' #endif ' ) + aadd( txt_, ' void keyPressEvent( QKeyEvent * event ); ' ) + aadd( txt_, ' void mouseMoveEvent( QMouseEvent * event ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'signals: ' ) + aadd( txt_, ' void sg_mouseMoveEvent( QMouseEvent * event ); ' ) + aadd( txt_, ' void sg_keyPressEvent( QKeyEvent * event ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'class MyMainWindow : public QMainWindow ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' Q_OBJECT ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'public: ' ) + aadd( txt_, ' MyMainWindow(); ' ) + aadd( txt_, ' virtual ~MyMainWindow(); ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'public: ' ) + aadd( txt_, ' void closeEvent( QCloseEvent *event ); ' ) + aadd( txt_, ' ' ) aadd( txt_, '}; ' ) aadd( txt_, ' ' ) aadd( txt_, '#endif ' ) aadd( txt_, ' ' ) + RETURN CreateTarget( cFile, txt_ ) /*----------------------------------------------------------------------*/ @@ -1869,392 +1956,478 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut ) BuildHeader( @txt_, 2 ) - aadd( txt_, '#include "hbapi.h" ' ) - aadd( txt_, '#include "hbvm.h" ' ) - aadd( txt_, '#include "hbapiitm.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include "hbqt.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#if QT_VERSION >= 0x040500 ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include "hbqt_slots.h" ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#include ' ) - aadd( txt_, '#include ' ) - aadd( txt_, '#include ' ) - aadd( txt_, ' ' ) - aadd( txt_, '#define HBQT_EVT_CLICKED 1 ' ) - aadd( txt_, '#define HBQT_EVT_TRIGGERED 2 ' ) - aadd( txt_, '#define HBQT_EVT_TRIGGERED_BOOL 3 ' ) - aadd( txt_, '#define HBQT_EVT_HOVERED 4 ' ) - aadd( txt_, '#define HBQT_EVT_STATECHANGED 5 ' ) - aadd( txt_, '#define HBQT_EVT_PRESSED 6 ' ) - aadd( txt_, '#define HBQT_EVT_RELEASED 7 ' ) - 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_, ' 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_, ' ' ) + aadd( txt_, '#include "hbapi.h" ' ) + aadd( txt_, '#include "hbvm.h" ' ) + aadd( txt_, '#include "hbapiitm.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include "hbqt.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#if QT_VERSION >= 0x040500 ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include "hbqt_slots.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#define HBQT_EVT_CLICKED 1 ' ) + aadd( txt_, '#define HBQT_EVT_TRIGGERED 2 ' ) + aadd( txt_, '#define HBQT_EVT_TRIGGERED_BOOL 3 ' ) + aadd( txt_, '#define HBQT_EVT_HOVERED 4 ' ) + aadd( txt_, '#define HBQT_EVT_STATECHANGED 5 ' ) + aadd( txt_, '#define HBQT_EVT_PRESSED 6 ' ) + aadd( txt_, '#define HBQT_EVT_RELEASED 7 ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static Slots *s = NULL; ' ) + aadd( txt_, ' ' ) + 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_, 'bool Slots::event( QEvent * event ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' bool bAccepted = true; ' ) + 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 ) "event()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); ' ) + aadd( txt_, ' bAccepted = hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pEvent ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' return bAccepted; ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::keyPressEvent( QKeyEvent * event ) ' ) + 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 ) "keyPressEvent()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pEvent ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void Slots::mouseMoveEvent( QMouseEvent * event ) ' ) + 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 ) "mouseMoveEvent()" ) && ( ( bool ) list4.at( i ) == true ) ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' ) + aadd( txt_, ' PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); ' ) + aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); ' ) + aadd( txt_, ' hb_itemRelease( pWidget ); ' ) + aadd( txt_, ' hb_itemRelease( pEvent ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' } ' ) + 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_, ' { ' ) + aadd( txt_, ' s = new Slots(); ' ) + aadd( txt_, ' } ' ) + 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() ) , ' ) + aadd( txt_, ' 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 ) ), ' ) + aadd( txt_, ' 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 ) ), ' ) + aadd( txt_, ' 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 ) ), ' ) + aadd( txt_, ' 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 ) ) , ' ) + aadd( txt_, ' 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 ) ), ' ) + aadd( txt_, ' 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 & ) ), ' ) + aadd( txt_, ' s, SLOT( clicked( const QModelIndex & ) ), Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "event()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( event( QEvent * ) ), ' ) + aadd( txt_, ' s, SLOT( event( QEvent * ) ) , Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "keyPressEvent()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( sg_keyPressEvent( QKeyEvent * ) ), ' ) + aadd( txt_, ' s, SLOT( keyPressEvent( QKeyEvent * ) ), Qt::AutoConnection ); ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' if( signal == ( QString ) "mouseMoveEvent()" ) ' ) + aadd( txt_, ' { ' ) + aadd( txt_, ' ret = widget->connect( widget, SIGNAL( sg_mouseMoveEvent( QMouseEvent * ) ), ' ) + aadd( txt_, ' s, SLOT( mouseMoveEvent( QMouseEvent * ) ), 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_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'MyMainWindow::MyMainWindow() ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' Qt::WindowFlags flags = Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint | ' ) + aadd( txt_, ' Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint | ' ) + aadd( txt_, ' Qt::CustomizeWindowHint | Qt::WindowTitleHint | ' ) + aadd( txt_, ' Qt::Window ; ' ) + aadd( txt_, ' setWindowFlags( flags ); ' ) + aadd( txt_, ' setFocusPolicy( Qt::StrongFocus ); ' ) + aadd( txt_, ' setAttribute( Qt::WA_DeleteOnClose ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'MyMainWindow::~MyMainWindow( void ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void MyMainWindow::closeEvent( QCloseEvent *event ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' event->accept(); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'MyDrawingArea::MyDrawingArea(QWidget *parent) ' ) + aadd( txt_, ' : QWidget(parent) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' setAttribute( Qt::WA_StaticContents ); ' ) + aadd( txt_, ' setAttribute( Qt::WA_PaintOnScreen ); ' ) + aadd( txt_, ' setAttribute( Qt::WA_DeleteOnClose ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' setFocusPolicy( Qt::StrongFocus ); ' ) + aadd( txt_, ' setMouseTracking( true ); ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' setAttribute( Qt::WA_InputMethodEnabled, true ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'MyDrawingArea::~MyDrawingArea( void ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'void MyDrawingArea::mouseMoveEvent( QMouseEvent * event ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' emit sg_mouseMoveEvent( event ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'void MyDrawingArea::keyPressEvent( QKeyEvent * event ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' emit sg_keyPressEvent( event ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'HB_FUNC( QT_MYMAINWINDOW ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' hb_retptr( ( MyMainWindow * ) new MyMainWindow() ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'HB_FUNC( QT_MYDRAWINGAREA ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' hb_retptr( ( MyDrawingArea * ) new MyDrawingArea() ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, '#endif ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) @@ -2266,108 +2439,232 @@ STATIC FUNCTION Build_MOC_SLOTS_CPP( cPathOut ) /* .......................................................................................................' */ - 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_, '/**************************************************************************** ' ) + aadd( txt_, '** Meta object code from reading C++ file hbqt_slots.h ' ) + aadd( txt_, '** ' ) + aadd( txt_, '** Created: Thu Jun 11 00:20:48 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_, ' 16, 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_, ' 243, 237, 232, 6, 0x0a, ' ) + aadd( txt_, ' 258, 237, 6, 6, 0x0a, ' ) + aadd( txt_, ' 284, 237, 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_, ' "bool\0event\0event(QEvent*)\0" ' ) + aadd( txt_, ' "keyPressEvent(QKeyEvent*)\0" ' ) + aadd( txt_, ' "mouseMoveEvent(QMouseEvent*)\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_, ' case 13: { bool _r = event((*reinterpret_cast< QEvent*(*)>(_a[1]))); ' ) + aadd( txt_, ' if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; ' ) + aadd( txt_, ' case 14: keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 15: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' ) + aadd( txt_, ' default: ; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' _id -= 16; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'static const uint qt_meta_data_MyDrawingArea[] = { ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' // content: ' ) + aadd( txt_, ' 2, // revision ' ) + aadd( txt_, ' 0, // classname ' ) + aadd( txt_, ' 0, 0, // classinfo ' ) + aadd( txt_, ' 2, 12, // methods ' ) + aadd( txt_, ' 0, 0, // properties ' ) + aadd( txt_, ' 0, 0, // enums/sets ' ) + aadd( txt_, ' 0, 0, // constructors ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' // signals: signature, parameters, type, tag, flags ' ) + aadd( txt_, ' 21, 15, 14, 14, 0x05, ' ) + aadd( txt_, ' 53, 15, 14, 14, 0x05, ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' 0 // eod ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static const char qt_meta_stringdata_MyDrawingArea[] = { ' ) + aadd( txt_, ' "MyDrawingArea\0\0event\0" ' ) + aadd( txt_, ' "sg_mouseMoveEvent(QMouseEvent*)\0" ' ) + aadd( txt_, ' "sg_keyPressEvent(QKeyEvent*)\0" ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject MyDrawingArea::staticMetaObject = { ' ) + aadd( txt_, ' { &QWidget::staticMetaObject, qt_meta_stringdata_MyDrawingArea, ' ) + aadd( txt_, ' qt_meta_data_MyDrawingArea, 0 } ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject *MyDrawingArea::metaObject() const ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' return &staticMetaObject; ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void *MyDrawingArea::qt_metacast(const char *_clname) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' if (!_clname) return 0; ' ) + aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyDrawingArea)) ' ) + aadd( txt_, ' return static_cast(const_cast< MyDrawingArea*>(this)); ' ) + aadd( txt_, ' return QWidget::qt_metacast(_clname); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'int MyDrawingArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' _id = QWidget::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: sg_mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' ) + aadd( txt_, ' case 1: sg_keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' ) + aadd( txt_, ' default: ; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' _id -= 2; ' ) + aadd( txt_, ' } ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '// SIGNAL 0 ' ) + aadd( txt_, 'void MyDrawingArea::sg_mouseMoveEvent(QMouseEvent * _t1) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; ' ) + aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 0, _a); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '// SIGNAL 1 ' ) + aadd( txt_, 'void MyDrawingArea::sg_keyPressEvent(QKeyEvent * _t1) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; ' ) + aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 1, _a); ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'static const uint qt_meta_data_MyMainWindow[] = { ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' // content: ' ) + aadd( txt_, ' 2, // revision ' ) + aadd( txt_, ' 0, // classname ' ) + aadd( txt_, ' 0, 0, // classinfo ' ) + aadd( txt_, ' 0, 0, // methods ' ) + aadd( txt_, ' 0, 0, // properties ' ) + aadd( txt_, ' 0, 0, // enums/sets ' ) + aadd( txt_, ' 0, 0, // constructors ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' 0 // eod ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'static const char qt_meta_stringdata_MyMainWindow[] = { ' ) + aadd( txt_, ' "MyMainWindow\0" ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject MyMainWindow::staticMetaObject = { ' ) + aadd( txt_, ' { &QMainWindow::staticMetaObject, qt_meta_stringdata_MyMainWindow, ' ) + aadd( txt_, ' qt_meta_data_MyMainWindow, 0 } ' ) + aadd( txt_, '}; ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'const QMetaObject *MyMainWindow::metaObject() const ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' return &staticMetaObject; ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'void *MyMainWindow::qt_metacast(const char *_clname) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' if (!_clname) return 0; ' ) + aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyMainWindow)) ' ) + aadd( txt_, ' return static_cast(const_cast< MyMainWindow*>(this)); ' ) + aadd( txt_, ' return QMainWindow::qt_metacast(_clname); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'int MyMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' _id = QMainWindow::qt_metacall(_c, _id, _a); ' ) + aadd( txt_, ' if (_id < 0) ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, ' return _id; ' ) + aadd( txt_, '} ' ) + aadd( txt_, 'QT_END_MOC_NAMESPACE ' ) aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) diff --git a/harbour/contrib/hbqt/generator/qt45.qtp b/harbour/contrib/hbqt/generator/qt45.qtp index 2a94c9707e..2c3c176deb 100644 --- a/harbour/contrib/hbqt/generator/qt45.qtp +++ b/harbour/contrib/hbqt/generator/qt45.qtp @@ -69,6 +69,7 @@ QImageReader.qth QImageWriter.qth QInputDialog.qth QInputEvent.qth +QKeyEvent.qth QLabel.qth QLayout.qth QLayoutItem.qth @@ -85,6 +86,7 @@ QMenu.qth QMenuBar.qth QMessageBox.qth QModelIndex.qth +QMouseEvent.qth QObject.qth QPaintDevice.qth QPageSetupDialog.qth diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index a5ab78f46a..a0fdc093bb 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -312,6 +312,8 @@ #define hbqt_par_QAbstractListModel( n ) ( ( QAbstractListModel* ) hb_parptr( n ) ) #define hbqt_par_QAbstractTableModel( n ) ( ( QAbstractTableModel* ) hb_parptr( n ) ) #define hbqt_par_QFileSystemModel( n ) ( ( QFileSystemModel* ) hb_parptr( n ) ) +#define hbqt_par_QKeyEvent( n ) ( ( QKeyEvent* ) hb_parptr( n ) ) +#define hbqt_par_QMouseEvent( n ) ( ( QMouseEvent* ) hb_parptr( n ) ) #define hbqt_par_QString( n ) ( ( QString ) hb_parc( n ) ) #define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) diff --git a/harbour/contrib/hbqt/hbqt_qkeyevent.cpp b/harbour/contrib/hbqt/hbqt_qkeyevent.cpp new file mode 100644 index 0000000000..1cbcf31017 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qkeyevent.cpp @@ -0,0 +1,150 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + + +#include + + +/* + * QKeyEvent ( Type type, int key, Qt::KeyboardModifiers modifiers, const QString & text = QString(), bool autorep = false, ushort count = 1 ) + */ +HB_FUNC( QT_QKEYEVENT ) +{ + //hb_retptr( ( QKeyEvent * ) new QKeyEvent( *hbqt_par_QKeyEvent( 1 ) ) ); +} + +/* + * int count () const + */ +HB_FUNC( QT_QKEYEVENT_COUNT ) +{ + hb_retni( hbqt_par_QKeyEvent( 1 )->count() ); +} + +/* + * bool isAutoRepeat () const + */ +HB_FUNC( QT_QKEYEVENT_ISAUTOREPEAT ) +{ + hb_retl( hbqt_par_QKeyEvent( 1 )->isAutoRepeat() ); +} + +/* + * int key () const + */ +HB_FUNC( QT_QKEYEVENT_KEY ) +{ + hb_retni( hbqt_par_QKeyEvent( 1 )->key() ); +} + +/* + * bool matches ( QKeySequence::StandardKey key ) const + */ +HB_FUNC( QT_QKEYEVENT_MATCHES ) +{ + hb_retl( hbqt_par_QKeyEvent( 1 )->matches( ( QKeySequence::StandardKey ) hb_parni( 2 ) ) ); +} + +/* + * Qt::KeyboardModifiers modifiers () const + */ +HB_FUNC( QT_QKEYEVENT_MODIFIERS ) +{ + hb_retni( ( Qt::KeyboardModifiers ) hbqt_par_QKeyEvent( 1 )->modifiers() ); +} + +/* + * quint32 nativeModifiers () const + */ +HB_FUNC( QT_QKEYEVENT_NATIVEMODIFIERS ) +{ + hb_retni( hbqt_par_QKeyEvent( 1 )->nativeModifiers() ); +} + +/* + * quint32 nativeScanCode () const + */ +HB_FUNC( QT_QKEYEVENT_NATIVESCANCODE ) +{ + hb_retni( hbqt_par_QKeyEvent( 1 )->nativeScanCode() ); +} + +/* + * quint32 nativeVirtualKey () const + */ +HB_FUNC( QT_QKEYEVENT_NATIVEVIRTUALKEY ) +{ + hb_retni( hbqt_par_QKeyEvent( 1 )->nativeVirtualKey() ); +} + +/* + * QString text () const + */ +HB_FUNC( QT_QKEYEVENT_TEXT ) +{ + hb_retc( hbqt_par_QKeyEvent( 1 )->text().toLatin1().data() ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qmouseevent.cpp b/harbour/contrib/hbqt/hbqt_qmouseevent.cpp new file mode 100644 index 0000000000..9ceac4fa08 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qmouseevent.cpp @@ -0,0 +1,151 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + + +#include + + +/* + * QMouseEvent ( Type type, const QPoint & position, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + * QMouseEvent ( Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + */ +HB_FUNC( QT_QMOUSEEVENT ) +{ + hb_retptr( ( QMouseEvent * ) new QMouseEvent( *hbqt_par_QMouseEvent( 1 ) ) ); +} + +/* + * Qt::MouseButton button () const + */ +HB_FUNC( QT_QMOUSEEVENT_BUTTON ) +{ + hb_retni( ( Qt::MouseButton ) hbqt_par_QMouseEvent( 1 )->button() ); +} + +/* + * Qt::MouseButtons buttons () const + */ +HB_FUNC( QT_QMOUSEEVENT_BUTTONS ) +{ + hb_retni( ( Qt::MouseButtons ) hbqt_par_QMouseEvent( 1 )->buttons() ); +} + +/* + * const QPoint & globalPos () const + */ +HB_FUNC( QT_QMOUSEEVENT_GLOBALPOS ) +{ + hb_retptr( new QPoint( hbqt_par_QMouseEvent( 1 )->globalPos() ) ); +} + +/* + * int globalX () const + */ +HB_FUNC( QT_QMOUSEEVENT_GLOBALX ) +{ + hb_retni( hbqt_par_QMouseEvent( 1 )->globalX() ); +} + +/* + * int globalY () const + */ +HB_FUNC( QT_QMOUSEEVENT_GLOBALY ) +{ + hb_retni( hbqt_par_QMouseEvent( 1 )->globalY() ); +} + +/* + * const QPoint & pos () const + */ +HB_FUNC( QT_QMOUSEEVENT_POS ) +{ + hb_retptr( new QPoint( hbqt_par_QMouseEvent( 1 )->pos() ) ); +} + +/* + * QPointF posF () const + */ +HB_FUNC( QT_QMOUSEEVENT_POSF ) +{ + hb_retptr( new QPointF( hbqt_par_QMouseEvent( 1 )->posF() ) ); +} + +/* + * int x () const + */ +HB_FUNC( QT_QMOUSEEVENT_X ) +{ + hb_retni( hbqt_par_QMouseEvent( 1 )->x() ); +} + +/* + * int y () const + */ +HB_FUNC( QT_QMOUSEEVENT_Y ) +{ + hb_retni( hbqt_par_QMouseEvent( 1 )->y() ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_slots.cpp b/harbour/contrib/hbqt/hbqt_slots.cpp index 2c865cf8db..323c3b2de4 100644 --- a/harbour/contrib/hbqt/hbqt_slots.cpp +++ b/harbour/contrib/hbqt/hbqt_slots.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #define HBQT_EVT_CLICKED 1 #define HBQT_EVT_TRIGGERED 2 @@ -78,6 +79,7 @@ static Slots *s = NULL; +/*----------------------------------------------------------------------*/ static void SlotsExec( QWidget* widget, QString event, PHB_ITEM pItem ) { @@ -131,6 +133,65 @@ Slots::~Slots() { } +bool Slots::event( QEvent * event ) +{ + bool bAccepted = true; + 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 ) "event()" ) && ( ( bool ) list4.at( i ) == true ) ) + { + PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); + PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); + bAccepted = hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); + hb_itemRelease( pWidget ); + hb_itemRelease( pEvent ); + } + } + } + return bAccepted; +} + +void Slots::keyPressEvent( QKeyEvent * event ) +{ + 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 ) "keyPressEvent()" ) && ( ( bool ) list4.at( i ) == true ) ) + { + PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); + PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); + hb_itemRelease( pWidget ); + hb_itemRelease( pEvent ); + } + } + } +} + +void Slots::mouseMoveEvent( QMouseEvent * event ) +{ + 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 ) "mouseMoveEvent()" ) && ( ( bool ) list4.at( i ) == true ) ) + { + PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); + PHB_ITEM pEvent = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); + hb_itemRelease( pWidget ); + hb_itemRelease( pEvent ); + } + } + } +} + void Slots::clicked() { QWidget *widget = qobject_cast( sender() ); @@ -249,7 +310,9 @@ HB_FUNC( QT_CONNECT_SIGNAL ) /* 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 @@ -275,7 +338,7 @@ HB_FUNC( QT_CONNECT_SIGNAL ) } if( signal == ( QString ) "viewportEntered()" ) { - ret = widget->connect( widget, SIGNAL( viewportEntered() ), s, SLOT( viewportEntered() ) , Qt::AutoConnection ); + ret = widget->connect( widget, SIGNAL( viewportEntered() ) , s, SLOT( viewportEntered() ) , Qt::AutoConnection ); } if( signal == ( QString ) "pressed()" ) { @@ -283,34 +346,56 @@ HB_FUNC( QT_CONNECT_SIGNAL ) } if( signal == ( QString ) "released()" ) { - ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); + 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 ); + 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 ); + 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 ); + 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 ); + 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 ); + 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 ); + ret = widget->connect( widget, SIGNAL( clicked_model( const QModelIndex & ) ), + s, SLOT( clicked( const QModelIndex & ) ), Qt::AutoConnection ); + } + if( signal == ( QString ) "event()" ) + { + ret = widget->connect( widget, SIGNAL( event( QEvent * ) ), + s, SLOT( event( QEvent * ) ) , Qt::AutoConnection ); + } + if( signal == ( QString ) "keyPressEvent()" ) + { + ret = widget->connect( widget, SIGNAL( sg_keyPressEvent( QKeyEvent * ) ), + s, SLOT( keyPressEvent( QKeyEvent * ) ), Qt::AutoConnection ); + } + if( signal == ( QString ) "mouseMoveEvent()" ) + { + ret = widget->connect( widget, SIGNAL( sg_mouseMoveEvent( QMouseEvent * ) ), + s, SLOT( mouseMoveEvent( QMouseEvent * ) ), Qt::AutoConnection ); } /* return connect result */ @@ -377,64 +462,65 @@ void release_codeblocks( void ) } } -#if 0 -HB_FUNC( QT_CONNECT_SIGNAL_1 ) +/*----------------------------------------------------------------------*/ + +MyMainWindow::MyMainWindow() { - QWidget * widget = ( QWidget* ) hb_parptr( 1 ); /* get sender */ - int signal = hb_parni( 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 - */ - switch( signal ) - { - case HBQT_EVT_CLICKED: - ret = widget->connect( widget, SIGNAL( clicked() ) , s, SLOT( clicked() ) , Qt::AutoConnection ); - break; - case HBQT_EVT_TRIGGERED: - ret = widget->connect( widget, SIGNAL( triggered() ) , s, SLOT( triggered() ) , Qt::AutoConnection ); - break; - case HBQT_EVT_TRIGGERED_BOOL: - ret = widget->connect( widget, SIGNAL( triggered( bool ) ) , s, SLOT( triggered( bool ) ) , Qt::AutoConnection ); - break; - case HBQT_EVT_HOVERED: - ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); - break; - case HBQT_EVT_STATECHANGED: - ret = widget->connect( widget, SIGNAL( stateChanged( int ) ), s, SLOT( stateChanged( int ) ), Qt::AutoConnection ); - break; - case HBQT_EVT_PRESSED: - ret = widget->connect( widget, SIGNAL( pressed() ) , s, SLOT( pressed() ) , Qt::AutoConnection ); - break; - case HBQT_EVT_RELEASED: - ret = widget->connect( widget, SIGNAL( released() ) , s, SLOT( released() ) , Qt::AutoConnection ); - break; - } - - /* 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; - } + Qt::WindowFlags flags = Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint | + Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint | + Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::Window ; + setWindowFlags( flags ); + setFocusPolicy( Qt::StrongFocus ); + setAttribute( Qt::WA_DeleteOnClose ); +} + +MyMainWindow::~MyMainWindow( void ) +{ +} + +void MyMainWindow::closeEvent( QCloseEvent *event ) +{ + event->accept(); +} + +MyDrawingArea::MyDrawingArea(QWidget *parent) + : QWidget(parent) +{ + setAttribute( Qt::WA_StaticContents ); + setAttribute( Qt::WA_PaintOnScreen ); + setAttribute( Qt::WA_DeleteOnClose ); + + setFocusPolicy( Qt::StrongFocus ); + setMouseTracking( true ); + + setAttribute( Qt::WA_InputMethodEnabled, true ); +} + +MyDrawingArea::~MyDrawingArea( void ) +{ +} +void MyDrawingArea::mouseMoveEvent( QMouseEvent * event ) +{ + emit sg_mouseMoveEvent( event ); +} +void MyDrawingArea::keyPressEvent( QKeyEvent * event ) +{ + emit sg_keyPressEvent( event ); +} + +HB_FUNC( QT_MYMAINWINDOW ) +{ + hb_retptr( ( MyMainWindow * ) new MyMainWindow() ); +} + +HB_FUNC( QT_MYDRAWINGAREA ) +{ + hb_retptr( ( MyDrawingArea * ) new MyDrawingArea() ); } -#endif /*----------------------------------------------------------------------*/ #endif + diff --git a/harbour/contrib/hbqt/hbqt_slots.h b/harbour/contrib/hbqt/hbqt_slots.h index 88da7522d3..9a8f3600c3 100644 --- a/harbour/contrib/hbqt/hbqt_slots.h +++ b/harbour/contrib/hbqt/hbqt_slots.h @@ -58,8 +58,13 @@ #define SLOTS_H #include +#include #include #include +#include +#include +#include + #include "hbapi.h" #include "hbapiitm.h" @@ -68,7 +73,7 @@ class Slots: public QObject { Q_OBJECT - public: +public: Slots( QObject *parent = 0 ); ~Slots(); QList list1; @@ -76,7 +81,7 @@ class Slots: public QObject QList list3; QList list4; - public slots: +public slots: void clicked(); void triggered(); void triggered( bool checked ); @@ -90,6 +95,85 @@ class Slots: public QObject void returnPressed(); void clicked_model( const QModelIndex & index ); void viewportEntered(); + bool event( QEvent *event ); + void keyPressEvent( QKeyEvent * event ); + void mouseMoveEvent( QMouseEvent * event ); + +#if 0 + void accessibleEvent(); + void actionEvent(); + void childEvent(); + void closeEvent(); + void customEvent(); + void dragLeaveEvent(); + void dropEvent(); + void dynamicPropertyChangeEvent(); + void fileOpenEvent(); + void focusEvent(); + void graphicsSceneEvent(); + void helpEvent(); + void hideEvent(); + void hoverEvent(); + void iconDragEvent(); + void inputEvent(); + void inputMethodEvent(); + void moveEvent(); + void paintEvent(); + void resizeEvent(); + void shortcutEvent(); + void showEvent(); + void statusTipEvent(); + void timerEvent(); + void whatsThisClickedEvent(); + void windowStateChangeEvent(); +#endif +}; + + +class MyDrawingArea : public QWidget +{ + Q_OBJECT + +public: + MyDrawingArea( QWidget *parent = 0 ); + virtual ~MyDrawingArea( void ); + + #if 0 +protected slots: + void keyReleaseEvent( QKeyEvent * event ); + void mousePressEvent( QMouseEvent * event ); + void mouseReleaseEvent( QMouseEvent * event ); + void mouseDoubleClickEvent( QMouseEvent * event ); + void paintEvent( QPaintEvent * event ); + void resizeEvent( QResizeEvent * event ); + void wheelEvent( QWheelEvent * event ); + void timerEvent( QTimerEvent * event ); + void focusInEvent( QFocusEvent * event ); + void focusOutEvent( QFocusEvent * event ); + void moveEvent( QMoveEvent * event ); + bool event( QEvent * event ); + #endif + void keyPressEvent( QKeyEvent * event ); + void mouseMoveEvent( QMouseEvent * event ); + +signals: + void sg_mouseMoveEvent( QMouseEvent * event ); + void sg_keyPressEvent( QKeyEvent * event ); + +}; + + +class MyMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MyMainWindow(); + virtual ~MyMainWindow(); + +public: + void closeEvent( QCloseEvent *event ); + }; #endif diff --git a/harbour/contrib/hbqt/moc_slots.cpp b/harbour/contrib/hbqt/moc_slots.cpp index 9770ac973e..4ec7b105a9 100644 --- a/harbour/contrib/hbqt/moc_slots.cpp +++ b/harbour/contrib/hbqt/moc_slots.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file hbqt_slots.h ** -** Created: Sun Jun 7 21:29:21 2009 +** Created: Thu Jun 11 00:20:48 2009 ** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ** ** WARNING! All changes made in this file will be lost! @@ -23,7 +23,7 @@ static const uint qt_meta_data_Slots[] = { 2, // revision 0, // classname 0, 0, // classinfo - 13, 12, // methods + 16, 12, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -42,6 +42,9 @@ static const uint qt_meta_data_Slots[] = { 171, 6, 6, 6, 0x0a, 187, 108, 6, 6, 0x0a, 214, 6, 6, 6, 0x0a, + 243, 237, 232, 6, 0x0a, + 258, 237, 6, 6, 0x0a, + 284, 237, 6, 6, 0x0a, 0 // eod }; @@ -53,6 +56,9 @@ static const char qt_meta_stringdata_Slots[] = { "index\0activated(int)\0currentIndexChanged(int)\0" "highlighted(int)\0returnPressed()\0" "clicked_model(QModelIndex)\0viewportEntered()\0" + "bool\0event\0event(QEvent*)\0" + "keyPressEvent(QKeyEvent*)\0" + "mouseMoveEvent(QMouseEvent*)\0" }; const QMetaObject Slots::staticMetaObject = { @@ -93,11 +99,129 @@ int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) case 10: returnPressed(); break; case 11: clicked_model((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 12: viewportEntered(); break; + case 13: { bool _r = event((*reinterpret_cast< QEvent*(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; + case 14: keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; + case 15: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; default: ; } - _id -= 13; + _id -= 16; } return _id; } +static const uint qt_meta_data_MyDrawingArea[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 2, 12, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + // signals: signature, parameters, type, tag, flags + 21, 15, 14, 14, 0x05, + 53, 15, 14, 14, 0x05, + + 0 // eod +}; + +static const char qt_meta_stringdata_MyDrawingArea[] = { + "MyDrawingArea\0\0event\0" + "sg_mouseMoveEvent(QMouseEvent*)\0" + "sg_keyPressEvent(QKeyEvent*)\0" +}; + +const QMetaObject MyDrawingArea::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_MyDrawingArea, + qt_meta_data_MyDrawingArea, 0 } +}; + +const QMetaObject *MyDrawingArea::metaObject() const +{ + return &staticMetaObject; +} + +void *MyDrawingArea::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MyDrawingArea)) + return static_cast(const_cast< MyDrawingArea*>(this)); + return QWidget::qt_metacast(_clname); +} + +int MyDrawingArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: sg_mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; + case 1: sg_keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; + default: ; + } + _id -= 2; + } + return _id; +} + +// SIGNAL 0 +void MyDrawingArea::sg_mouseMoveEvent(QMouseEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void MyDrawingArea::sg_keyPressEvent(QKeyEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} +static const uint qt_meta_data_MyMainWindow[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + 0 // eod +}; + +static const char qt_meta_stringdata_MyMainWindow[] = { + "MyMainWindow\0" +}; + +const QMetaObject MyMainWindow::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_MyMainWindow, + qt_meta_data_MyMainWindow, 0 } +}; + +const QMetaObject *MyMainWindow::metaObject() const +{ + return &staticMetaObject; +} + +void *MyMainWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MyMainWindow)) + return static_cast(const_cast< MyMainWindow*>(this)); + return QMainWindow::qt_metacast(_clname); +} + +int MyMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} QT_END_MOC_NAMESPACE diff --git a/harbour/contrib/hbqt/qth/QKeyEvent.qth b/harbour/contrib/hbqt/qth/QKeyEvent.qth new file mode 100644 index 0000000000..63644ace75 --- /dev/null +++ b/harbour/contrib/hbqt/qth/QKeyEvent.qth @@ -0,0 +1,101 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +; +; Header File to Generate QT Wrapper Sources +; + + +Inherits = QInputEvent +Type = Core +New = + + + +#include + + +/* + * QKeyEvent ( Type type, int key, Qt::KeyboardModifiers modifiers, const QString & text = QString(), bool autorep = false, ushort count = 1 ) + */ +HB_FUNC( QT_QKEYEVENT ) +{ + //hb_retptr( ( QKeyEvent * ) new QKeyEvent( *hbqt_par_QKeyEvent( 1 ) ) ); +} + + + + + + +int count () const +bool isAutoRepeat () const +int key () const +bool matches ( QKeySequence::StandardKey key ) const +Qt::KeyboardModifiers modifiers () const +quint32 nativeModifiers () const +quint32 nativeScanCode () const +quint32 nativeVirtualKey () const +QString text () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QMouseEvent.qth b/harbour/contrib/hbqt/qth/QMouseEvent.qth new file mode 100644 index 0000000000..c61ef5616c --- /dev/null +++ b/harbour/contrib/hbqt/qth/QMouseEvent.qth @@ -0,0 +1,102 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +; +; Header File to Generate QT Wrapper Sources +; + + +Inherits = QInputEvent +Type = Core +New = + + + +#include + + +/* + * QMouseEvent ( Type type, const QPoint & position, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + * QMouseEvent ( Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + */ +HB_FUNC( QT_QMOUSEEVENT ) +{ + hb_retptr( ( QMouseEvent * ) new QMouseEvent( *hbqt_par_QMouseEvent( 1 ) ) ); +} + + + + + + +Qt::MouseButton button () const +Qt::MouseButtons buttons () const +const QPoint & globalPos () const +int globalX () const +int globalY () const +const QPoint & pos () const +QPointF posF () const +int x () const +int y () const + + + + + + + + + + + + +