diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c8a7efc3ea..cade02e015 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2012-05-05 20:30 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtcore/qth/QDataStream.qth + * contrib/hbqt/qtcore/qth/QDateTime.qth + * contrib/hbqt/qtcore/qth/QFile.qth + * contrib/hbqt/qtcore/qth/QFileInfo.qth + * contrib/hbqt/qtcore/qth/QFileSystemWatcher.qth + * contrib/hbqt/qtcore/qth/QRect.qth + * contrib/hbqt/qtcore/qth/QRectF.qth + * contrib/hbqt/qtcore/qth/QTextStream.qth + * contrib/hbqt/qtcore/qth/QVariant.qth + - Replaced: HBQT_TYPE_Qxxx => hbqt_par_isDerivedFrom(). + Now it is safe to remove HBQT_TYPE_Qxxx constants from + hbqtcore. + 2012-05-05 20:30 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbmk2_qt.hbs * Optimized: HB_ISLOG( n ) ? hb_parl( n ) : false | true ) diff --git a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth index cd7037828b..7f3fb6b185 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth @@ -33,16 +33,16 @@ HB_FUNC( QT_QDATASTREAM ) { if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QIODevice ) ) + if( hbqt_par_isDerivedFrom( 1, "QIODEVICE" ) ) { __HB_RETPTRGC__( new QDataStream( hbqt_par_QIODevice( 1 ) ) ); } - else if( hbqt_isObjectType( 1, HBQT_TYPE_QByteArray ) ) + else if( hbqt_par_isDerivedFrom( 1, "QBYTEARRAY" ) ) { __HB_RETPTRGC__( new QDataStream( *hbqt_par_QByteArray( 1 ) ) ); } } - if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) ) + 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/QDateTime.qth b/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth index c3b56d2880..d79397182c 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth @@ -33,11 +33,11 @@ HB_FUNC( QT_QDATETIME ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QDate ) ) + if( hbqt_par_isDerivedFrom( 1, "QDATE" ) ) { __HB_RETPTRGC__( new QDateTime( *hbqt_par_QDate( 1 ) ) ); } - else if( hbqt_isObjectType( 1, HBQT_TYPE_QDateTime ) ) + else if( hbqt_par_isDerivedFrom( 1, "QDATETIME" ) ) { __HB_RETPTRGC__( new QDateTime( *hbqt_par_QDateTime( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QFile.qth b/harbour/contrib/hbqt/qtcore/qth/QFile.qth index 9e24207d46..900911ed9c 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QFile.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QFile.qth @@ -32,11 +32,11 @@ HB_FUNC( QT_QFILE ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QFile ) ) + if( hbqt_par_isDerivedFrom( 1, "QFILE" ) ) { __HB_RETPTRGC__( new QFile( hbqt_par_QFile( 1 ) ) ); } - else + else if( hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QFile( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth b/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth index 6a2f05f214..862d988263 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth @@ -42,16 +42,16 @@ HB_FUNC( QT_QFILEINFO ) } else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QFile ) ) + if( hbqt_par_isDerivedFrom( 1, "QFILE" ) ) { __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QFile( 1 ) ) ); } - else if( hbqt_isObjectType( 1, HBQT_TYPE_QFileInfo ) ) + else if( hbqt_par_isDerivedFrom( 1, "QFILEINFO" ) ) { __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QFileInfo( 1 ) ) ); } } - if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISCHAR( 2 ) ) + if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QDIR" ) && HB_ISCHAR( 2 ) ) { __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QDir( 1 ), hbqt_par_QString( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QFileSystemWatcher.qth b/harbour/contrib/hbqt/qtcore/qth/QFileSystemWatcher.qth index c5dcf0da7f..004e2cf42a 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QFileSystemWatcher.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QFileSystemWatcher.qth @@ -30,14 +30,18 @@ HB_FUNC( QT_QFILESYSTEMWATCHER ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QStringList ) ) + if( hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) ) { __HB_RETPTRGC__( new QFileSystemWatcher( *hbqt_par_QStringList( 1 ) ) ); } - else + else if( hbqt_par_isDerivedFrom( 1, "QOBJECT" ) ) { __HB_RETPTRGC__( new QFileSystemWatcher( hbqt_par_QObject( 1 ) ) ); } + else + { + __HB_RETPTRGC__( new QFileSystemWatcher() ); + } } else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) { diff --git a/harbour/contrib/hbqt/qtcore/qth/QRect.qth b/harbour/contrib/hbqt/qtcore/qth/QRect.qth index 6be7c6746f..c3b500bf6c 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QRect.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QRect.qth @@ -31,20 +31,24 @@ New = */ HB_FUNC( QT_QRECT ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QRECT" ) ) { __HB_RETPTRGC__( new QRect( *hbqt_par_QRect( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QPOINT" ) && HB_ISOBJECT( 2 ) ) { - if( hbqt_isObjectType( 2, HBQT_TYPE_QPoint ) ) + if( hbqt_par_isDerivedFrom( 2, "QPOINT" ) ) { __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) ); } - if( hbqt_isObjectType( 2, HBQT_TYPE_QSize ) ) + else if( hbqt_par_isDerivedFrom( 2, "QSIZE" ) ) { __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QSize( 2 ) ) ); } + else + { + __HB_RETPTRGC__( new QRect() ); + } } else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { diff --git a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth index d88ee0b5c1..c84a919b5b 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth @@ -31,20 +31,24 @@ New = */ HB_FUNC( QT_QRECTF ) { - if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QRECTF" ) ) { __HB_RETPTRGC__( new QRectF( *hbqt_par_QRectF( 1 ) ) ); } - else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) ) + else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QPOINT" ) && HB_ISOBJECT( 2 ) ) { - if( hbqt_isObjectType( 2, HBQT_TYPE_QPointF ) ) + if( hbqt_par_isDerivedFrom( 2, "QPOINTF" ) ) { __HB_RETPTRGC__( new QRectF( *hbqt_par_QPointF( 1 ), *hbqt_par_QPointF( 2 ) ) ); } - if( hbqt_isObjectType( 2, HBQT_TYPE_QSizeF ) ) + else if( hbqt_par_isDerivedFrom( 2, "QSIZEF" ) ) { __HB_RETPTRGC__( new QRectF( *hbqt_par_QPointF( 1 ), *hbqt_par_QSizeF( 2 ) ) ); } + else + { + __HB_RETPTRGC__( new QRectF() ); + } } else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) { diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth b/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth index 4f03eacc7e..5c05e07065 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth @@ -34,11 +34,11 @@ HB_FUNC( QT_QTEXTSTREAM ) { if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) ) { - if( hbqt_isObjectType( 1, HBQT_TYPE_QIODevice ) ) + if( hbqt_par_isDerivedFrom( 1, "QIODEVICE" ) ) { __HB_RETPTRGC__( new QTextStream( hbqt_par_QIODevice( 1 ) ) ); } - else if( hbqt_isObjectType( 1, HBQT_TYPE_QByteArray ) ) + else if( hbqt_par_isDerivedFrom( 1, "QBYTEARRAY" ) ) { __HB_RETPTRGC__( new QTextStream( hbqt_par_QByteArray( 1 ), ( QIODevice::OpenMode ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : QIODevice::ReadWrite ) ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qth/QVariant.qth b/harbour/contrib/hbqt/qtcore/qth/QVariant.qth index 296f797fbf..bfd1b6167e 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QVariant.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QVariant.qth @@ -71,85 +71,83 @@ HB_FUNC( QT_QVARIANT ) { if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { - HB_U32 iType = hbqt_getObjectType( 1 ); - - if( iType == HBQT_TYPE_QVariant ) + if( hbqt_par_isDerivedFrom( 1, "QVARIANT" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QVariant( 1 ) ) ); } - else if( iType == HBQT_TYPE_QByteArray ) + else if( hbqt_par_isDerivedFrom( 1, "QBYTEARRAY" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QByteArray( 1 ) ) ); } - else if( iType == HBQT_TYPE_QBitArray ) + else if( hbqt_par_isDerivedFrom( 1, "QBITARRAY" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QBitArray( 1 ) ) ); } - else if( iType == HBQT_TYPE_QLatin1String ) + else if( hbqt_par_isDerivedFrom( 1, "QLATIN1STRING" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QLatin1String( 1 ) ) ); } - else if( iType == HBQT_TYPE_QStringList ) + else if( hbqt_par_isDerivedFrom( 1, "QSTRINGLIST" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QStringList( 1 ) ) ); } - else if( iType == HBQT_TYPE_QDate ) + else if( hbqt_par_isDerivedFrom( 1, "QDATE" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QDate( 1 ) ) ); } - else if( iType == HBQT_TYPE_QTime ) + else if( hbqt_par_isDerivedFrom( 1, "QTIME" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QTime( 1 ) ) ); } - else if( iType == HBQT_TYPE_QDateTime ) + else if( hbqt_par_isDerivedFrom( 1, "QDATETIME" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QDateTime( 1 ) ) ); } - else if( iType == HBQT_TYPE_QChar ) + else if( hbqt_par_isDerivedFrom( 1, "QCHAR" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QChar( 1 ) ) ); } - else if( iType == HBQT_TYPE_QSize ) + else if( hbqt_par_isDerivedFrom( 1, "QSIZE" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QSize( 1 ) ) ); } - else if( iType == HBQT_TYPE_QSizeF ) + else if( hbqt_par_isDerivedFrom( 1, "QSIZEF" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QSizeF( 1 ) ) ); } - else if( iType == HBQT_TYPE_QRect ) + else if( hbqt_par_isDerivedFrom( 1, "QRECT" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QRect( 1 ) ) ); } - else if( iType == HBQT_TYPE_QRectF ) + else if( hbqt_par_isDerivedFrom( 1, "QRECTF" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QRectF( 1 ) ) ); } - else if( iType == HBQT_TYPE_QPoint ) + else if( hbqt_par_isDerivedFrom( 1, "QPOINT" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QPoint( 1 ) ) ); } - else if( iType == HBQT_TYPE_QPointF ) + else if( hbqt_par_isDerivedFrom( 1, "QPOINTF" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QPointF( 1 ) ) ); } - else if( iType == HBQT_TYPE_QLine ) + else if( hbqt_par_isDerivedFrom( 1, "QLINE" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QLine( 1 ) ) ); } - else if( iType == HBQT_TYPE_QLineF ) + else if( hbqt_par_isDerivedFrom( 1, "QLINEF" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QLineF( 1 ) ) ); } - else if( iType == HBQT_TYPE_QUrl ) + else if( hbqt_par_isDerivedFrom( 1, "QURL" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QUrl( 1 ) ) ); } - else if( iType == HBQT_TYPE_QLocale ) + else if( hbqt_par_isDerivedFrom( 1, "QLOCALE" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QLocale( 1 ) ) ); } - else if( iType == HBQT_TYPE_QRegExp ) + else if( hbqt_par_isDerivedFrom( 1, "QREGEXP" ) ) { __HB_RETPTRGC__( new QVariant( *hbqt_par_QRegExp( 1 ) ) ); }