From 7233d39e7e97e2e716996c5308887c45b3a6a6cd Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sat, 2 Jun 2012 00:22:08 +0000 Subject: [PATCH] 2012-06-01 17:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth * contrib/hbqt/qtgui/qth/QAction.qth * contrib/hbqt/qtgui/qth/QBoxLayout.qth * contrib/hbqt/qtgui/qth/QFormLayout.qth * contrib/hbqt/qtgui/qth/QFrame.qth * contrib/hbqt/qtgui/qth/QGridLayout.qth * contrib/hbqt/qtgui/qth/QLineEdit.qth * contrib/hbqt/qtgui/qth/QPushButton.qth * contrib/hbqt/qtgui/qth/QScrollArea.qth * contrib/hbqt/qtgui/qth/QSizeGrip.qth * contrib/hbqt/qtgui/qth/QSlider.qth * contrib/hbqt/qtgui/qth/QSound.qth * contrib/hbqt/qtgui/qth/QSpinBox.qth * contrib/hbqt/qtgui/qth/QSplashScreen.qth * contrib/hbqt/qtgui/qth/QSplitter.qth * contrib/hbqt/qtgui/qth/QStackedWidget.qth * contrib/hbqt/qtgui/qth/QStandardItem.qth * contrib/hbqt/qtgui/qth/QStandardItemModel.qth * contrib/hbqt/qtgui/qth/QStringListModel.qth * contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth * contrib/hbqt/qtgui/qth/QTabBar.qth * contrib/hbqt/qtgui/qth/QTableWidget.qth * contrib/hbqt/qtgui/qth/QTabWidget.qth * contrib/hbqt/qtgui/qth/QTextBrowser.qth * contrib/hbqt/qtgui/qth/QTextDocument.qth * contrib/hbqt/qtgui/qth/QTextEdit.qth * contrib/hbqt/qtgui/qth/QTextFormat.qth * contrib/hbqt/qtgui/qth/QTimeEdit.qth * contrib/hbqt/qtgui/qth/QToolBox.qth * contrib/hbqt/qtgui/qth/QToolButton.qth * contrib/hbqt/qtgui/qth/QTreeView.qth * contrib/hbqt/qtgui/qth/QTreeWidget.qth * contrib/hbqt/qtgui/qth/QWidgetAction.qth * contrib/hbqt/qtgui/qth/QWidgetItem.qth * contrib/hbqt/qtgui/qth/QWizardPage.qth ! Fixed: constructors. Now hbIDE shows up with __HBQT_REVAMP__. --- harbour/ChangeLog | 38 ++++++++++++++++ .../hbqt/qtgui/qth/HBQSyntaxHighlighter.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QAction.qth | 10 ++--- harbour/contrib/hbqt/qtgui/qth/QBoxLayout.qth | 13 +++++- .../contrib/hbqt/qtgui/qth/QFormLayout.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QFrame.qth | 13 +++++- .../contrib/hbqt/qtgui/qth/QGridLayout.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QLineEdit.qth | 21 ++++++++- .../contrib/hbqt/qtgui/qth/QPushButton.qth | 44 ++++++++++--------- .../contrib/hbqt/qtgui/qth/QScrollArea.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QSizeGrip.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QSlider.qth | 16 ++++++- harbour/contrib/hbqt/qtgui/qth/QSound.qth | 19 ++++++-- harbour/contrib/hbqt/qtgui/qth/QSpinBox.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QSplashScreen.qth | 17 ++++++- harbour/contrib/hbqt/qtgui/qth/QSplitter.qth | 18 ++++++-- .../contrib/hbqt/qtgui/qth/QStackedWidget.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QStandardItem.qth | 17 ++++++- .../hbqt/qtgui/qth/QStandardItemModel.qth | 17 ++++++- .../hbqt/qtgui/qth/QStringListModel.qth | 17 ++++++- .../hbqt/qtgui/qth/QSystemTrayIcon.qth | 17 ++++++- harbour/contrib/hbqt/qtgui/qth/QTabBar.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QTabWidget.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QTableWidget.qth | 18 ++++++-- .../contrib/hbqt/qtgui/qth/QTextBrowser.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QTextDocument.qth | 4 +- harbour/contrib/hbqt/qtgui/qth/QTextEdit.qth | 16 ++++++- .../contrib/hbqt/qtgui/qth/QTextFormat.qth | 13 +++++- harbour/contrib/hbqt/qtgui/qth/QTimeEdit.qth | 17 ++++++- harbour/contrib/hbqt/qtgui/qth/QToolBox.qth | 13 +++++- .../contrib/hbqt/qtgui/qth/QToolButton.qth | 9 +++- harbour/contrib/hbqt/qtgui/qth/QTreeView.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QTreeWidget.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QWidgetAction.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QWidgetItem.qth | 9 +++- .../contrib/hbqt/qtgui/qth/QWizardPage.qth | 9 +++- 36 files changed, 433 insertions(+), 69 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index aa0c878949..cf5e19b9e7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,44 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-01 17:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth + * contrib/hbqt/qtgui/qth/QAction.qth + * contrib/hbqt/qtgui/qth/QBoxLayout.qth + * contrib/hbqt/qtgui/qth/QFormLayout.qth + * contrib/hbqt/qtgui/qth/QFrame.qth + * contrib/hbqt/qtgui/qth/QGridLayout.qth + * contrib/hbqt/qtgui/qth/QLineEdit.qth + * contrib/hbqt/qtgui/qth/QPushButton.qth + * contrib/hbqt/qtgui/qth/QScrollArea.qth + * contrib/hbqt/qtgui/qth/QSizeGrip.qth + * contrib/hbqt/qtgui/qth/QSlider.qth + * contrib/hbqt/qtgui/qth/QSound.qth + * contrib/hbqt/qtgui/qth/QSpinBox.qth + * contrib/hbqt/qtgui/qth/QSplashScreen.qth + * contrib/hbqt/qtgui/qth/QSplitter.qth + * contrib/hbqt/qtgui/qth/QStackedWidget.qth + * contrib/hbqt/qtgui/qth/QStandardItem.qth + * contrib/hbqt/qtgui/qth/QStandardItemModel.qth + * contrib/hbqt/qtgui/qth/QStringListModel.qth + * contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth + * contrib/hbqt/qtgui/qth/QTabBar.qth + * contrib/hbqt/qtgui/qth/QTableWidget.qth + * contrib/hbqt/qtgui/qth/QTabWidget.qth + * contrib/hbqt/qtgui/qth/QTextBrowser.qth + * contrib/hbqt/qtgui/qth/QTextDocument.qth + * contrib/hbqt/qtgui/qth/QTextEdit.qth + * contrib/hbqt/qtgui/qth/QTextFormat.qth + * contrib/hbqt/qtgui/qth/QTimeEdit.qth + * contrib/hbqt/qtgui/qth/QToolBox.qth + * contrib/hbqt/qtgui/qth/QToolButton.qth + * contrib/hbqt/qtgui/qth/QTreeView.qth + * contrib/hbqt/qtgui/qth/QTreeWidget.qth + * contrib/hbqt/qtgui/qth/QWidgetAction.qth + * contrib/hbqt/qtgui/qth/QWidgetItem.qth + * contrib/hbqt/qtgui/qth/QWizardPage.qth + ! Fixed: constructors. Now hbIDE shows up with __HBQT_REVAMP__. + 2012-06-01 08:05 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/HBQTableView.qth * contrib/hbqt/qtgui/qth/QHeaderView.qth diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth b/harbour/contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth index 29264659cc..1b896e9c4d 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth @@ -36,7 +36,14 @@ New = */ HB_FUNC( QT_HBQSYNTAXHIGHLIGHTER ) { - __HB_RETPTRGC__( new HBQSyntaxHighlighter( hbqt_par_QTextDocument( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QTEXTDOCUMENT" ) ) + { + __HB_RETPTRGC__( new HBQSyntaxHighlighter( hbqt_par_QTextDocument( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new HBQSyntaxHighlighter() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QAction.qth b/harbour/contrib/hbqt/qtgui/qth/QAction.qth index 200b843754..d81ab3b774 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QAction.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QAction.qth @@ -32,21 +32,19 @@ Calls = QT_QAction */ HB_FUNC( QT_QACTION ) { - int pcount; - pcount = hb_pcount(); - if( pcount == 3 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) && hbqt_par_isDerivedFrom( 3, "QOBJECT" ) ) + if( hb_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 ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) + else if( hb_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_RETPTRGC__( new QAction( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QObject( 2 ) ) ); hb_strfree( pText01 ); } - else if( pcount == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QAction( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QBoxLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QBoxLayout.qth index dbb76c463d..11b3b11a96 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QBoxLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QBoxLayout.qth @@ -26,7 +26,18 @@ New = nDirection, pParent */ HB_FUNC( QT_QBOXLAYOUT ) { - __HB_RETPTRGC__( new QBoxLayout( ( QBoxLayout::Direction ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QBoxLayout( ( QBoxLayout::Direction ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QBoxLayout( ( QBoxLayout::Direction ) 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/QFormLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QFormLayout.qth index 5800add34d..5972245b2b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFormLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFormLayout.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QFORMLAYOUT ) { - __HB_RETPTRGC__( new QFormLayout( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QFormLayout( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QFormLayout() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFrame.qth b/harbour/contrib/hbqt/qtgui/qth/QFrame.qth index d990dee2ee..d5d332c5cd 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFrame.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFrame.qth @@ -26,7 +26,18 @@ New = pParent, nFlags */ HB_FUNC( QT_QFRAME ) { - __HB_RETPTRGC__( new QFrame( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QFrame( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QFrame( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QFrame() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGridLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QGridLayout.qth index ff24278902..170301fb72 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGridLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGridLayout.qth @@ -27,7 +27,14 @@ New = pParent */ HB_FUNC( QT_QGRIDLAYOUT ) { - __HB_RETPTRGC__( new QGridLayout( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QGridLayout( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QGridLayout() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QLineEdit.qth b/harbour/contrib/hbqt/qtgui/qth/QLineEdit.qth index 823638d8cd..cad4e0bb85 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QLineEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QLineEdit.qth @@ -28,7 +28,26 @@ New = pParent */ HB_FUNC( QT_QLINEEDIT ) { - __HB_RETPTRGC__( new QLineEdit( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QLineEdit( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QLineEdit( hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QLineEdit( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QWidget( 2 ) ) ); + hb_strfree( pText01 ); + } + else + { + __HB_RETPTRGC__( new QLineEdit() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QPushButton.qth b/harbour/contrib/hbqt/qtgui/qth/QPushButton.qth index ad945895a2..a9df0e1fbb 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPushButton.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPushButton.qth @@ -15,7 +15,7 @@ Inherit = QAbstractButton New = pParent -PaintEvent = YES +PaintEvent = NO @@ -30,32 +30,34 @@ PaintEvent = YES */ HB_FUNC( QT_QPUSHBUTTON ) { -/* - if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) ) - { - void * pText01 = NULL; - __HB_RETPTRGC__( new QPushButton( hb_parstr_utf8( 1, &pText01, NULL ), HB_ISOBJECT( 2 ) ? hbqt_par_QWidget( 2 ) : 0 ) ); - hb_strfree( pText01 ); - } - else if( hb_pcount() >= 2 && HB_ISOBJECT( 1 ) && HB_ISCHAR( 2 ) ) - { - void * pText01 = NULL; - __HB_RETPTRGC__( new QPushButton( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), HB_ISOBJECT( 3 ) ? hbqt_par_QWidget( 3 ) : 0 ) ); - hb_strfree( pText01 ); - } - else - { - __HB_RETPTRGC__( new QPushButton( HB_ISOBJECT( 1 ) ? hbqt_par_QWidget( 1 ) : 0 ) ); - } -*/ if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) { __HB_RETPTRGC__( new QPushButton( hbqt_par_QWidget( 1 ) ) ); } - else +#if 0 + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { + void * pText01 = NULL; + __HB_RETPTRGC__( new QPushButton( ( const char * ) hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QPushButton( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QWidget( 2 ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QPushButton( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } +#endif + else + { __HB_RETPTRGC__( new QPushButton() ); - } + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QScrollArea.qth b/harbour/contrib/hbqt/qtgui/qth/QScrollArea.qth index 1aa857f303..f45b150e77 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QScrollArea.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QScrollArea.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QSCROLLAREA ) { - __HB_RETPTRGC__( new QScrollArea( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QScrollArea( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QScrollArea() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSizeGrip.qth b/harbour/contrib/hbqt/qtgui/qth/QSizeGrip.qth index 4d6bccd561..3dbd95558f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSizeGrip.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSizeGrip.qth @@ -26,6 +26,13 @@ New = pParent */ HB_FUNC( QT_QSIZEGRIP ) { - __HB_RETPTRGC__( new QSizeGrip( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QSizeGrip( hbqt_par_QWidget( 1 ) ) ); + } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSlider.qth b/harbour/contrib/hbqt/qtgui/qth/QSlider.qth index b37ce1303c..da6f6dd77b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSlider.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSlider.qth @@ -27,10 +27,22 @@ New = pParent */ HB_FUNC( QT_QSLIDER ) { - if( hb_pcount() >= 1 && HB_ISNUM( 1 ) ) + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { __HB_RETPTRGC__( new QSlider( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); - else + } + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { __HB_RETPTRGC__( new QSlider( hbqt_par_QWidget( 1 ) ) ); + } + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QSlider( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QSlider() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSound.qth b/harbour/contrib/hbqt/qtgui/qth/QSound.qth index 05931c9d60..f7f80e9af0 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSound.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSound.qth @@ -27,9 +27,22 @@ New = */ HB_FUNC( QT_QSOUND ) { - void * pText01 = NULL; - __HB_RETPTRGC__( new QSound( hb_parstr_utf8( 1, &pText01, NULL ) ) ); - hb_strfree( pText01 ); + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QSound( 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 QSound( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QObject( 2 ) ) ); + hb_strfree( pText01 ); + } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSpinBox.qth b/harbour/contrib/hbqt/qtgui/qth/QSpinBox.qth index 6b073ca504..3270a90ff2 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSpinBox.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSpinBox.qth @@ -25,7 +25,14 @@ New = pParent */ HB_FUNC( QT_QSPINBOX ) { - __HB_RETPTRGC__( new QSpinBox( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QSpinBox( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QSpinBox() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSplashScreen.qth b/harbour/contrib/hbqt/qtgui/qth/QSplashScreen.qth index 45a6d04e87..867d66af74 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSplashScreen.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSplashScreen.qth @@ -27,7 +27,22 @@ New = pParent */ HB_FUNC( QT_QSPLASHSCREEN ) { - __HB_RETPTRGC__( new QSplashScreen( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QPIXMAP" ) ) + { + __HB_RETPTRGC__( new QSplashScreen( *hbqt_par_QPixmap( 1 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QSplashScreen( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) && hbqt_par_isDerivedFrom( 2, "QPIXMAP" ) ) + { + __HB_RETPTRGC__( new QSplashScreen( hbqt_par_QWidget( 1 ), *hbqt_par_QPixmap( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QSplashScreen() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSplitter.qth b/harbour/contrib/hbqt/qtgui/qth/QSplitter.qth index e8d02567eb..95fa9f5e4b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSplitter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSplitter.qth @@ -27,10 +27,22 @@ New = pParent */ HB_FUNC( QT_QSPLITTER ) { - if( hb_pcount() >= 1 && HB_ISNUM( 1 ) ) - __HB_RETPTRGC__( new QSplitter( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); - else + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { __HB_RETPTRGC__( new QSplitter( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QSplitter( ( Qt::Orientation ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QSplitter( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QSplitter() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QStackedWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QStackedWidget.qth index 07b4a0cc9d..d5dd3facff 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QStackedWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QStackedWidget.qth @@ -35,7 +35,14 @@ New = */ HB_FUNC( QT_QSTACKEDWIDGET ) { - __HB_RETPTRGC__( new QStackedWidget( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QStackedWidget( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QStackedWidget() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QStandardItem.qth b/harbour/contrib/hbqt/qtgui/qth/QStandardItem.qth index 554b74affe..968ac9bcf9 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QStandardItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QStandardItem.qth @@ -31,7 +31,22 @@ New = */ HB_FUNC( QT_QSTANDARDITEM ) { - __HB_RETPTRGC__( new QStandardItem() ); + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QStandardItem( hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QICON" ) && HB_ISCHAR( 2 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QStandardItem( *hbqt_par_QIcon( 1 ), hb_parstr_utf8( 2, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else + { + __HB_RETPTRGC__( new QStandardItem() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QStandardItemModel.qth b/harbour/contrib/hbqt/qtgui/qth/QStandardItemModel.qth index 42bb0178a4..846bb517ca 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QStandardItemModel.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QStandardItemModel.qth @@ -28,7 +28,22 @@ New = */ HB_FUNC( QT_QSTANDARDITEMMODEL ) { - __HB_RETPTRGC__( new QStandardItemModel( hbqt_par_QObject( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QStandardItemModel( hbqt_par_QObject( 1 ) ) ); + } + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QStandardItemModel( hb_parni( 1 ), hb_parni( 2 ) ) ); + } + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && hbqt_par_isDerivedFrom( 3, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QStandardItemModel( hb_parni( 1 ), hb_parni( 2 ), hbqt_par_QObject( 3 ) ) ); + } + else + { + __HB_RETPTRGC__( new QStandardItemModel() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QStringListModel.qth b/harbour/contrib/hbqt/qtgui/qth/QStringListModel.qth index 6587b3a20a..7543fbde50 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QStringListModel.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QStringListModel.qth @@ -27,7 +27,22 @@ New = */ HB_FUNC( QT_QSTRINGLISTMODEL ) { - __HB_RETPTRGC__( new QStringListModel() ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QStringListModel( hbqt_par_QObject( 1 ) ) ); + } + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) ) + { + __HB_RETPTRGC__( new QStringListModel( *hbqt_par_QStringList( 1 ) ) ); + } + if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QStringListModel( *hbqt_par_QStringList( 1 ), hbqt_par_QObject( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QStringListModel() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth b/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth index 7604b944d2..620f0fa606 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth @@ -28,7 +28,22 @@ New = */ HB_FUNC( QT_QSYSTEMTRAYICON ) { - __HB_RETPTRGC__( new QSystemTrayIcon( hbqt_par_QObject( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QSystemTrayIcon( hbqt_par_QObject( 1 ) ) ); + } + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QICON" ) ) + { + __HB_RETPTRGC__( new QSystemTrayIcon( *hbqt_par_QIcon( 1 ) ) ); + } + if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QICON" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QSystemTrayIcon( *hbqt_par_QIcon( 1 ), hbqt_par_QObject( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QSystemTrayIcon() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTabBar.qth b/harbour/contrib/hbqt/qtgui/qth/QTabBar.qth index 8ef4031a3c..6fd86eaa8c 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTabBar.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTabBar.qth @@ -27,7 +27,14 @@ New = pParent */ HB_FUNC( QT_QTABBAR ) { - __HB_RETPTRGC__( new QTabBar( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTabBar( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTabBar() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTabWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QTabWidget.qth index c7f5dca68f..c1fd6678e3 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTabWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTabWidget.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QTABWIDGET ) { - __HB_RETPTRGC__( new QTabWidget( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTabWidget( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTabWidget() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTableWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QTableWidget.qth index 406b945ef9..decf77f570 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTableWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTableWidget.qth @@ -27,10 +27,22 @@ New = pParent */ HB_FUNC( QT_QTABLEWIDGET ) { - if( hb_pcount() >= 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) - __HB_RETPTRGC__( new QTableWidget( hb_parni( 1 ), hb_parni( 2 ), hbqt_par_QWidget( 3 ) ) ); - else + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { __HB_RETPTRGC__( new QTableWidget( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QTableWidget( hb_parni( 1 ), hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && hbqt_par_isDerivedFrom( 3, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTableWidget( hb_parni( 1 ), hb_parni( 2 ), hbqt_par_QWidget( 3 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTableWidget() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextBrowser.qth b/harbour/contrib/hbqt/qtgui/qth/QTextBrowser.qth index b07cbc390e..d436b92e06 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextBrowser.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextBrowser.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QTEXTBROWSER ) { - __HB_RETPTRGC__( new QTextBrowser( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTextBrowser( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTextBrowser() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth b/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth index d2f873e111..7a15e40bc5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextDocument.qth @@ -30,7 +30,7 @@ New = */ HB_FUNC( QT_QTEXTDOCUMENT ) { - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QObject" ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QTextDocument( hbqt_par_QObject( 1 ) ) ); } @@ -40,7 +40,7 @@ HB_FUNC( QT_QTEXTDOCUMENT ) __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" ) ) + 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 ) ) ); diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextEdit.qth b/harbour/contrib/hbqt/qtgui/qth/QTextEdit.qth index f28b642f2c..c51f0f91b9 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextEdit.qth @@ -26,14 +26,26 @@ New = pParent */ HB_FUNC( QT_QTEXTEDIT ) { - if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTextEdit( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + void * pText01 = NULL; + __HB_RETPTRGC__( new QTextEdit( hb_parstr_utf8( 1, &pText01, NULL ) ) ); + hb_strfree( pText01 ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) { void * pText01 = NULL; __HB_RETPTRGC__( new QTextEdit( hb_parstr_utf8( 1, &pText01, NULL ), hbqt_par_QWidget( 2 ) ) ); hb_strfree( pText01 ); } else - __HB_RETPTRGC__( new QTextEdit( hbqt_par_QWidget( 1 ) ) ); + { + __HB_RETPTRGC__( new QTextEdit() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTextFormat.qth b/harbour/contrib/hbqt/qtgui/qth/QTextFormat.qth index 7a579eb9f2..7134693209 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTextFormat.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTextFormat.qth @@ -30,7 +30,18 @@ New = pParent */ HB_FUNC( QT_QTEXTFORMAT ) { - __HB_RETPTRGC__( new QTextFormat() ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QTextFormat( hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QTEXTFORMAT" ) ) + { + __HB_RETPTRGC__( new QTextFormat( *hbqt_par_QTextFormat( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTextFormat() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTimeEdit.qth b/harbour/contrib/hbqt/qtgui/qth/QTimeEdit.qth index e1c431ed88..48ce10404b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTimeEdit.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTimeEdit.qth @@ -26,6 +26,21 @@ New = pParent */ HB_FUNC( QT_QTIMEEDIT ) { - __HB_RETPTRGC__( new QTimeEdit( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTimeEdit( hbqt_par_QWidget( 1 ) ) ); + } + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QTIME" ) ) + { + __HB_RETPTRGC__( new QTimeEdit( *hbqt_par_QTime( 1 ) ) ); + } + if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QTIME" ) && hbqt_par_isDerivedFrom( 2, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTimeEdit( *hbqt_par_QTime( 1 ), hbqt_par_QWidget( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTimeEdit() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QToolBox.qth b/harbour/contrib/hbqt/qtgui/qth/QToolBox.qth index 59fd7a8778..1de78e9c89 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QToolBox.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QToolBox.qth @@ -26,7 +26,18 @@ New = pParent, nFlags */ HB_FUNC( QT_QTOOLBOX ) { - __HB_RETPTRGC__( new QToolBox( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QToolBox( hbqt_par_QWidget( 1 ) ) ); + } + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QToolBox( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); + } + else + { + __HB_RETPTRGC__( new QToolBox() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QToolButton.qth b/harbour/contrib/hbqt/qtgui/qth/QToolButton.qth index f6d7762bab..75e03bd244 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QToolButton.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QToolButton.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QTOOLBUTTON ) { - __HB_RETPTRGC__( new QToolButton( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QToolButton( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QToolButton() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTreeView.qth b/harbour/contrib/hbqt/qtgui/qth/QTreeView.qth index b81c0524f7..86aa1c927f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTreeView.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTreeView.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QTREEVIEW ) { - __HB_RETPTRGC__( new QTreeView( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTreeView( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTreeView() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QTreeWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QTreeWidget.qth index cb4b3bfc0b..c3d13e5f7a 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QTreeWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QTreeWidget.qth @@ -26,7 +26,14 @@ New = pParent */ HB_FUNC( QT_QTREEWIDGET ) { - __HB_RETPTRGC__( new QTreeWidget( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QTreeWidget( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QTreeWidget() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QWidgetAction.qth b/harbour/contrib/hbqt/qtgui/qth/QWidgetAction.qth index 2276234c01..a181a15cf2 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWidgetAction.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWidgetAction.qth @@ -27,7 +27,14 @@ New = */ HB_FUNC( QT_QWIDGETACTION ) { - __HB_RETPTRGC__( new QWidgetAction( hbqt_par_QObject( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) + { + __HB_RETPTRGC__( new QWidgetAction( 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/QWidgetItem.qth b/harbour/contrib/hbqt/qtgui/qth/QWidgetItem.qth index 865017ace2..cbd115a1cf 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWidgetItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWidgetItem.qth @@ -27,7 +27,14 @@ New = */ HB_FUNC( QT_QWIDGETITEM ) { - __HB_RETPTRGC__( new QWidgetItem( hbqt_par_QWidget( 1 ) ) ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QWidgetItem( hbqt_par_QWidget( 1 ) ) ); + } + else + { + hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QWizardPage.qth b/harbour/contrib/hbqt/qtgui/qth/QWizardPage.qth index 1dafe31ba5..30f91ac91b 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWizardPage.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWizardPage.qth @@ -27,7 +27,14 @@ Destructor = */ HB_FUNC( QT_QWIZARDPAGE ) { - __HB_RETPTRGC__( new QWizardPage() ); + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + { + __HB_RETPTRGC__( new QWizardPage( hbqt_par_QWidget( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QWizardPage() ); + } }