From 8fd32d2325f530ff35f99e4b45378b4aca508e29 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 7 May 2012 08:03:49 +0000 Subject: [PATCH] 2012-05-07 00:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth * contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth * contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth * contrib/hbqt/qtgui/qth/QAction.qth * contrib/hbqt/qtgui/qth/QActionEvent.qth * contrib/hbqt/qtgui/qth/QActionGroup.qth * contrib/hbqt/qtgui/qth/QBrush.qth * contrib/hbqt/qtgui/qth/QButtonGroup.qth * contrib/hbqt/qtgui/qth/QCloseEvent.qth * contrib/hbqt/qtgui/qth/QColor.qth * contrib/hbqt/qtgui/qth/QComboBox.qth * contrib/hbqt/qtgui/qth/QContextMenuEvent.qth - Replaced: HB_ISOBJECT( n ) => hbqt_par_isDerivedFrom( n, "QXXX" ) --- harbour/ChangeLog | 15 +++++++++++++++ .../contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth | 4 ++-- .../contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth | 2 +- .../contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QAction.qth | 10 +++++++--- harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth | 14 +++++++++++--- harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth | 6 +++++- harbour/contrib/hbqt/qtgui/qth/QBrush.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QCloseEvent.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QColor.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QComboBox.qth | 9 ++++++++- .../contrib/hbqt/qtgui/qth/QContextMenuEvent.qth | 12 ++++++++---- 13 files changed, 62 insertions(+), 20 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 58974c6820..1f17a62195 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2012-05-07 00:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth + * contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth + * contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth + * contrib/hbqt/qtgui/qth/QAction.qth + * contrib/hbqt/qtgui/qth/QActionEvent.qth + * contrib/hbqt/qtgui/qth/QActionGroup.qth + * contrib/hbqt/qtgui/qth/QBrush.qth + * contrib/hbqt/qtgui/qth/QButtonGroup.qth + * contrib/hbqt/qtgui/qth/QCloseEvent.qth + * contrib/hbqt/qtgui/qth/QColor.qth + * contrib/hbqt/qtgui/qth/QComboBox.qth + * contrib/hbqt/qtgui/qth/QContextMenuEvent.qth + - Replaced: HB_ISOBJECT( n ) => hbqt_par_isDerivedFrom( n, "QXXX" ) + 2012-05-06 23:36 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/qth/QAbstractEventDispatcher.qth * contrib/hbqt/qtcore/qth/QBitArray.qth diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth index 556f0dd33d..1271f969ca 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth @@ -45,7 +45,7 @@ HBQT_GC_FUNC( hbqt_gcMark_HBQGraphicsItem ) /* * HBQGraphicsItem () - * HBQGraphicsItem ( QGraphicsItem * parent ) + * HBQGraphicsItem ( int type ) * HBQGraphicsItem ( int type, QGraphicsItem * parent ) * ~HBQGraphicsItem () */ @@ -55,7 +55,7 @@ HB_FUNC( QT_HBQGRAPHICSITEM ) { __HB_RETPTRGC__( new HBQGraphicsItem( hb_parni( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QGRAPHICSITEM" ) ) { __HB_RETPTRGC__( new HBQGraphicsItem( hb_parni( 1 ), hbqt_par_QGraphicsItem( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth index c46fe41fae..68c68873e9 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth @@ -49,7 +49,7 @@ HBQT_GC_FUNC( hbqt_gcMark_HBQGraphicsScene ) */ HB_FUNC( QT_HBQGRAPHICSSCENE ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new HBQGraphicsScene( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth b/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth index b644730ebc..976ddc1107 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth @@ -58,7 +58,7 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT ) { __HB_RETPTRGC__( new HBQPlainTextEdit() ); } - else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) { __HB_RETPTRGC__( new HBQPlainTextEdit( hbqt_par_QWidget( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QAction.qth b/harbour/contrib/hbqt/qtgui/qth/QAction.qth index 9a6a6fd5c1..c6521c320f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QAction.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QAction.qth @@ -34,22 +34,26 @@ HB_FUNC( QT_QACTION ) { int pcount; pcount = hb_pcount(); - if( pcount == 3 && HB_ISOBJECT( 1 ) && HB_ISCHAR( 2 ) && HB_ISOBJECT( 3 ) ) + if( pcount == 3 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) && hbqt_par_isDerivedFrom( 3, "QOBJECT" ) ) { void * pText01 = NULL; __HB_RETPTRGC__( new QAction( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), hbqt_par_QObject( 3 ) ) ); hb_strfree( pText01 ); } - else if( pcount == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) ) + else if( pcount == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) { void * pText01 = NULL; __HB_RETPTRGC__( new QAction(hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QObject( 2 ) ) ); hb_strfree( pText01 ); } - else if( pcount == 1 && HB_ISOBJECT( 1 ) ) + else if( pcount == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + { __HB_RETPTRGC__( new QAction( hbqt_par_QObject( 1 ) ) ); + } else + { hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth index 8a6e0bd0df..015ad6f6f3 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth @@ -70,14 +70,22 @@ New = */ HB_FUNC( QT_QACTIONEVENT ) { - if( hb_pcount() <= 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && ( hb_pcount() == 3 ? HB_ISOBJECT( 3 ) : false ) ) + if( hb_pcount() == 3 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QACTION" ) && hbqt_par_isDerivedFrom( 3, "QACTION" ) ) { - __HB_RETPTRGC__( new QActionEvent( hb_parni( 1 ), hbqt_par_QAction( 2 ), ( HB_ISOBJECT( 3 ) ? hbqt_par_QAction( 3 ) : 0 ) ) ); + __HB_RETPTRGC__( new QActionEvent( hb_parni( 1 ), hbqt_par_QAction( 2 ), hbqt_par_QAction( 3 ) ) ); } - else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QACTION" ) ) + { + __HB_RETPTRGC__( new QActionEvent( hb_parni( 1 ), hbqt_par_QAction( 2 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QACTIONEVENT" ) ) { __HB_RETPTRGC__( new QActionEvent( *hbqt_par_QActionEvent( 1 ) ) ); } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth b/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth index 3ac4c1d2af..fb12fa330b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QActionGroup.qth @@ -26,10 +26,14 @@ New = */ HB_FUNC( QT_QACTIONGROUP ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QActionGroup( hbqt_par_QObject( 1 ) ) ); } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth index 8687cad13a..4579410656 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QBrush.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QBrush.qth @@ -76,7 +76,7 @@ HB_FUNC( QT_QBRUSH ) { __HB_RETPTRGC__( new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); } - else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QCOLOR" ) && HB_ISOBJECT( 2 ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QCOLOR" ) && hbqt_par_isDerivedFrom( 2, "QPIXMAP" ) ) { __HB_RETPTRGC__( new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth b/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth index d48b52023a..9ada2ea741 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QButtonGroup.qth @@ -27,7 +27,7 @@ New = */ HB_FUNC( QT_QBUTTONGROUP ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QButtonGroup( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QCloseEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QCloseEvent.qth index d214587dca..88e7e70f2e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QCloseEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QCloseEvent.qth @@ -28,7 +28,7 @@ New = */ HB_FUNC( QT_QCLOSEEVENT ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QCLOSEEVENT" ) ) { __HB_RETPTRGC__( new QCloseEvent( *hbqt_par_QCloseEvent( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QColor.qth b/harbour/contrib/hbqt/qtgui/qth/QColor.qth index b708a75ccf..15b5a7a87e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QColor.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QColor.qth @@ -50,7 +50,7 @@ HB_FUNC( QT_QCOLOR ) __HB_RETPTRGC__( new QColor( hb_parstr_utf8( 1, &pText01, NULL ) ) ); hb_strfree( pText01 ); } - else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QCOLOR" ) ) { __HB_RETPTRGC__( new QColor( *hbqt_par_QColor( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth b/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth index b640095d38..625aefed93 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QComboBox.qth @@ -30,7 +30,14 @@ Calls = QT_QComboBox */ HB_FUNC( QT_QCOMBOBOX ) { - __HB_RETPTRGC__( new QComboBox( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QComboBox( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QComboBox( 0 ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth index cb4d8601ba..dae84d3808 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth @@ -28,22 +28,26 @@ New = */ HB_FUNC( QT_QCONTEXTMENUEVENT ) { - if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) ) + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QPOINT" ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ) ) ); } - else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) ) + else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QPOINT" ) && hbqt_par_isDerivedFrom( 3, "QPOINT" ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); } - else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) && HB_ISNUM( 4 ) ) + else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QPOINT" ) && hbqt_par_isDerivedFrom( 3, "QPOINT" ) && HB_ISNUM( 4 ) ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ), ( Qt::KeyboardModifiers ) hb_parni( 4 ) ) ); } - else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 2, "QCONTEXTMENUEVENT" ) ) { __HB_RETPTRGC__( new QContextMenuEvent( *hbqt_par_QContextMenuEvent( 1 ) ) ); } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } }