diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0653095e09..aa0c878949 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-01 08:05 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/HBQTableView.qth + * contrib/hbqt/qtgui/qth/QHeaderView.qth + * contrib/hbqt/qtgui/qth/QListWidgetItem.qth + * contrib/hbqt/qtgui/qth/QStatusBar.qth + * contrib/hbqt/qtgui/qth/QTextDocument.qth + * contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth + ! Fixed: constructors for few more classes. + Now contrib/hbxbp/demoxbp.prg shows up at least. + 2012-05-31 23:32 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/QApplication.qth * contrib/hbqt/qtgui/qth/QColorDialog.qth diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQTableView.qth b/harbour/contrib/hbqt/qtgui/qth/HBQTableView.qth index 7f0ed9130b..354c2aa968 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQTableView.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQTableView.qth @@ -56,7 +56,14 @@ HBQT_GC_FUNC( hbqt_gcMark_HBQTableView ) */ HB_FUNC( QT_HBQTABLEVIEW ) { - __HB_RETPTRGC__( new HBQTableView( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new HBQTableView( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new HBQTableView() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QHeaderView.qth b/harbour/contrib/hbqt/qtgui/qth/QHeaderView.qth index 16d4b8d0b3..73f3278558 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QHeaderView.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QHeaderView.qth @@ -26,7 +26,18 @@ New = pParent */ HB_FUNC( QT_QHEADERVIEW ) { - __HB_RETPTRGC__( new QHeaderView( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QHeaderView( ( Qt::Orientation ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QHeaderView( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); + } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QListWidgetItem.qth b/harbour/contrib/hbqt/qtgui/qth/QListWidgetItem.qth index 0fbe3427aa..d2ff3f9594 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QListWidgetItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QListWidgetItem.qth @@ -30,7 +30,42 @@ New = pParent */ HB_FUNC( QT_QLISTWIDGETITEM ) { - __HB_RETPTRGC__( new QListWidgetItem( hbqt_par_QListWidget( 1 ), hb_parni( 2 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QLISTWIDGET" ) ) + { + __HB_RETPTRGC__( new QListWidgetItem( hbqt_par_QListWidget( 1 ), hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QLISTWIDGETITEM" ) ) + { + __HB_RETPTRGC__( new QListWidgetItem( *hbqt_par_QListWidgetItem( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QListWidgetItem( hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QLISTWIDGET" ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QListWidgetItem( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QListWidget( 2 ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QListWidgetItem( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 3 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) && hbqt_par_isDerivedFrom( 3, "QLISTWIDGET" ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QListWidgetItem( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), hbqt_par_QListWidget( 3 ) ) ); + hb_strfree( pText01 ); + } + else + { + __HB_RETPTRGC__( new QListWidgetItem() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QStatusBar.qth b/harbour/contrib/hbqt/qtgui/qth/QStatusBar.qth index da4b0a6c28..c256b53616 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QStatusBar.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QStatusBar.qth @@ -27,7 +27,14 @@ New = */ HB_FUNC( QT_QSTATUSBAR ) { - __HB_RETPTRGC__( new QStatusBar( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QStatusBar( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QStatusBar() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth b/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth index c2b4b9572f..d2f873e111 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth @@ -30,7 +30,26 @@ New = */ HB_FUNC( QT_QTEXTDOCUMENT ) { - __HB_RETPTRGC__( new QTextDocument( hbqt_par_QObject( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QObject" ) ) + { + __HB_RETPTRGC__( new QTextDocument( hbqt_par_QObject( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QTextDocument( hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QObject" ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QTextDocument( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QObject( 2 ) ) ); + hb_strfree( pText01 ); + } + else + { + __HB_RETPTRGC__( new QTextDocument() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth b/harbour/contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth index 185ac5bb0a..31d66870fa 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth @@ -34,14 +34,30 @@ New = iType */ HB_FUNC( QT_QTREEWIDGETITEM ) { - if( hb_pcount() >= 1 && HB_ISNUM( 1 ) ) + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { __HB_RETPTRGC__( new QTreeWidgetItem( hb_parni( 1 ) ) ); } - else + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QTREEWIDGET" ) ) + { + __HB_RETPTRGC__( new QTreeWidgetItem( hbqt_par_QTreeWidget( 1 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QTREEWIDGETITEM" ) ) + { + __HB_RETPTRGC__( new QTreeWidgetItem( hbqt_par_QTreeWidgetItem( 1 ) ) ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QTREEWIDGET" ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QTreeWidgetItem( hbqt_par_QTreeWidget( 1 ), hb_parni( 2 ) ) ); } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QTREEWIDGETITEM" ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QTreeWidgetItem( hbqt_par_QTreeWidgetItem( 1 ), hb_parni( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTreeWidgetItem() ); + } }