From 7065ffaa42fcf48dfe2c63f9763045d412653806 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 21 Jun 2012 01:51:06 +0000 Subject: [PATCH] 2012-06-20 18:44 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/qth/QDataStream.qth * contrib/hbqt/qtcore/qth/QEventLoop.qth * contrib/hbqt/qtcore/qth/QResource.qth * contrib/hbqt/qtcore/qth/QSettings.qth * contrib/hbqt/qtgui/qth/QCompleter.qth * contrib/hbqt/qtgui/qth/QFontDialog.qth * contrib/hbqt/qtgui/qth/QFontMetrics.qth * contrib/hbqt/qtgui/qth/QFontMetricsF.qth * contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth * contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth * contrib/hbqt/qtgui/qth/QGraphicsView.qth * contrib/hbqt/qtgui/qth/QSlider.qth * contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth * contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth ! Fixed: wrong "else if" in constructors. Now all classes has been scanned for this regression. Please report if you find something weired still. --- harbour/ChangeLog | 19 +++++++++++ .../contrib/hbqt/qtcore/qth/QDataStream.qth | 2 +- .../contrib/hbqt/qtcore/qth/QEventLoop.qth | 15 ++++----- harbour/contrib/hbqt/qtcore/qth/QResource.qth | 2 +- harbour/contrib/hbqt/qtcore/qth/QSettings.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QCompleter.qth | 8 ++--- .../contrib/hbqt/qtgui/qth/QFontDialog.qth | 2 +- .../contrib/hbqt/qtgui/qth/QFontMetrics.qth | 2 +- .../contrib/hbqt/qtgui/qth/QFontMetricsF.qth | 4 +-- .../hbqt/qtgui/qth/QGraphicsLinearLayout.qth | 32 +++++++++---------- .../hbqt/qtgui/qth/QGraphicsProxyWidget.qth | 2 +- .../contrib/hbqt/qtgui/qth/QGraphicsView.qth | 2 +- harbour/contrib/hbqt/qtgui/qth/QSlider.qth | 4 +-- .../hbqt/qtgui/qth/QSystemTrayIcon.qth | 4 +-- .../qtgui/qth/QWindowStateChangeEvent.qth | 2 +- 15 files changed, 59 insertions(+), 43 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1c5944443d..b3a70244d7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,25 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-20 18:44 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtcore/qth/QDataStream.qth + * contrib/hbqt/qtcore/qth/QEventLoop.qth + * contrib/hbqt/qtcore/qth/QResource.qth + * contrib/hbqt/qtcore/qth/QSettings.qth + * contrib/hbqt/qtgui/qth/QCompleter.qth + * contrib/hbqt/qtgui/qth/QFontDialog.qth + * contrib/hbqt/qtgui/qth/QFontMetrics.qth + * contrib/hbqt/qtgui/qth/QFontMetricsF.qth + * contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth + * contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth + * contrib/hbqt/qtgui/qth/QGraphicsView.qth + * contrib/hbqt/qtgui/qth/QSlider.qth + * contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth + * contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth + ! Fixed: wrong "else if" in constructors. + Now all classes has been scanned for this regression. + Please report if you find something weired still. + 2012-06-20 17:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqt_bind.cpp * contrib/hbqt/qtcore/qth/QLibraryInfo.qth diff --git a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth index c4a4f1a260..d54a32a213 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth @@ -39,7 +39,7 @@ HB_FUNC( QT_QDATASTREAM ) { __HB_RETPTRGC__( new QDataStream( *hbqt_par_QByteArray( 1 ) ) ); } - if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QBYTEARRAY" ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QBYTEARRAY" ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QDataStream( hbqt_par_QByteArray( 1 ), ( QIODevice::OpenMode ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth b/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth index 1cb428b93a..4c98cba592 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth @@ -27,17 +27,14 @@ New = pObject */ HB_FUNC( QT_QEVENTLOOP ) { - if( hb_pcount() >= 0 ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) - { - __HB_RETPTRGC__( new QEventLoop( hbqt_par_QObject( 1 ) ) ); - } - else - { - __HB_RETPTRGC__( new QEventLoop( 0 ) ); - } + __HB_RETPTRGC__( new QEventLoop( hbqt_par_QObject( 1 ) ) ); } + else + { + __HB_RETPTRGC__( new QEventLoop( 0 ) ); + } } diff --git a/harbour/contrib/hbqt/qtcore/qth/QResource.qth b/harbour/contrib/hbqt/qtcore/qth/QResource.qth index 89a8262d7f..d0d8ad6c07 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QResource.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QResource.qth @@ -36,7 +36,7 @@ HB_FUNC( QT_QRESOURCE ) __HB_RETPTRGC__( new QResource( hb_parstr_utf8( 1, &pText01, NULL ), *hbqt_par_QLocale( 2 ) ) ); hb_strfree( pText01 ); } - if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { void * pText01 = NULL; __HB_RETPTRGC__( new QResource( hb_parstr_utf8( 1, &pText01, NULL ), QLocale() ) ); diff --git a/harbour/contrib/hbqt/qtcore/qth/QSettings.qth b/harbour/contrib/hbqt/qtcore/qth/QSettings.qth index 287f944305..6386bfcd25 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QSettings.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QSettings.qth @@ -39,7 +39,7 @@ HB_FUNC( QT_QSETTINGS ) hb_strfree( pText01 ); hb_strfree( pText02 ); } - if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) { void * pText01 = NULL; void * pText02 = NULL; diff --git a/harbour/contrib/hbqt/qtgui/qth/QCompleter.qth b/harbour/contrib/hbqt/qtgui/qth/QCompleter.qth index 86e7bbfbab..29cd1b4522 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QCompleter.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QCompleter.qth @@ -32,19 +32,19 @@ HB_FUNC( QT_QCOMPLETER ) { __HB_RETPTRGC__( new QCompleter( hbqt_par_QObject( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QABSTRACTITEMMODEL" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QABSTRACTITEMMODEL" ) ) { __HB_RETPTRGC__( new QCompleter( hbqt_par_QAbstractItemModel( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) ) { __HB_RETPTRGC__( new QCompleter( *hbqt_par_QStringList( 1 ) ) ); } - if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QABSTRACTITEMMODEL" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QABSTRACTITEMMODEL" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) { __HB_RETPTRGC__( new QCompleter( hbqt_par_QAbstractItemModel( 1 ), hbqt_par_QObject( 2 ) ) ); } - if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) && hbqt_par_isDerivedFrom( 2, "QOBJECT" ) ) { __HB_RETPTRGC__( new QCompleter( *hbqt_par_QStringList( 1 ), hbqt_par_QObject( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth b/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth index ef380c35e5..31af83718f 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontDialog.qth @@ -30,7 +30,7 @@ HB_FUNC( QT_QFONTDIALOG ) { __HB_RETPTRGC__( new QFontDialog( hbqt_par_QWidget( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) { __HB_RETPTRGC__( new QFontDialog( *hbqt_par_QFont( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth b/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth index a6495c80cf..0039c8fcdf 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontMetrics.qth @@ -35,7 +35,7 @@ HB_FUNC( QT_QFONTMETRICS ) { __HB_RETPTRGC__( new QFontMetrics( *hbqt_par_QFontMetrics( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) { __HB_RETPTRGC__( new QFontMetrics( *hbqt_par_QFont( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth b/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth index 2076c73853..3196ca1da1 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFontMetricsF.qth @@ -36,11 +36,11 @@ HB_FUNC( QT_QFONTMETRICSF ) { __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFontMetrics( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONTMETRICSF" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONTMETRICSF" ) ) { __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFontMetricsF( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QFONT" ) ) { __HB_RETPTRGC__( new QFontMetricsF( *hbqt_par_QFont( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth index 7ff6985827..4e3b420f57 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsLinearLayout.qth @@ -29,22 +29,22 @@ New = */ HB_FUNC( QT_QGRAPHICSLINEARLAYOUT ) { - if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) - { - __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ) ) ); - } - else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QGRAPHICSLAYOUTITEM" ) ) - { - __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QGraphicsLayoutItem( 2 ) ) ); - } - else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QGRAPHICSLAYOUTITEM" ) ) - { - __HB_RETPTRGC__( new QGraphicsLinearLayout( hbqt_par_QGraphicsLayoutItem( 1 ) ) ); - } - else - { - __HB_RETPTRGC__( new QGraphicsLinearLayout() ); - } + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && hbqt_par_isDerivedFrom( 2, "QGRAPHICSLAYOUTITEM" ) ) + { + __HB_RETPTRGC__( new QGraphicsLinearLayout( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QGraphicsLayoutItem( 2 ) ) ); + } + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QGRAPHICSLAYOUTITEM" ) ) + { + __HB_RETPTRGC__( new QGraphicsLinearLayout( hbqt_par_QGraphicsLayoutItem( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QGraphicsLinearLayout() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth index d26e2d2ad5..cfc858b88a 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsProxyWidget.qth @@ -32,7 +32,7 @@ HB_FUNC( QT_QGRAPHICSPROXYWIDGET ) { __HB_RETPTRGC__( new QGraphicsProxyWidget( hbqt_par_QGraphicsItem( 1 ) ) ); } - if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) && HB_ISNUM( 2 ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) && HB_ISNUM( 2 ) ) { __HB_RETPTRGC__( new QGraphicsProxyWidget( hbqt_par_QGraphicsItem( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth b/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth index 1eb229cab9..8bb3868bfc 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QGraphicsView.qth @@ -33,7 +33,7 @@ HB_FUNC( QT_QGRAPHICSVIEW ) { __HB_RETPTRGC__( new QGraphicsView( hbqt_par_QGraphicsScene( 1 ), hbqt_par_QWidget( 2 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QGRAPHICSSCENE" ) ) + else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QGRAPHICSSCENE" ) ) { __HB_RETPTRGC__( new QGraphicsView( hbqt_par_QGraphicsScene( 1 ), 0 ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSlider.qth b/harbour/contrib/hbqt/qtgui/qth/QSlider.qth index da6f6dd77b..f4d6582a23 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSlider.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSlider.qth @@ -31,11 +31,11 @@ HB_FUNC( QT_QSLIDER ) { __HB_RETPTRGC__( new QSlider( ( Qt::Orientation ) hb_parni( 1 ), hbqt_par_QWidget( 2 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QWIDGET" ) ) + 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" ) ) + else 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 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth b/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth index 620f0fa606..ecbb7e9b06 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSystemTrayIcon.qth @@ -32,11 +32,11 @@ HB_FUNC( QT_QSYSTEMTRAYICON ) { __HB_RETPTRGC__( new QSystemTrayIcon( hbqt_par_QObject( 1 ) ) ); } - if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QICON" ) ) + else 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" ) ) + else 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 ) ) ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth index 10feb0a440..60419dd8f5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth @@ -32,7 +32,7 @@ HB_FUNC( QT_QWINDOWSTATECHANGEEVENT ) { __HB_RETPTRGC__( new QWindowStateChangeEvent( ( Qt::WindowStates ) hb_parni( 1 ), hb_parl( 2 ) ) ); } - if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { __HB_RETPTRGC__( new QWindowStateChangeEvent( ( Qt::WindowStates ) hb_parni( 1 ) ) ); }