diff --git a/harbour/ChangeLog b/harbour/ChangeLog
index f7f6fae9a3..8e6b1b2a98 100644
--- a/harbour/ChangeLog
+++ b/harbour/ChangeLog
@@ -16,6 +16,57 @@
The license applies to all entries newer than 2009-04-28.
*/
+2011-04-07 16:17 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
+ * contrib/hbqt/qtcore/qth/QBitArray.qth
+ * contrib/hbqt/qtcore/qth/QBuffer.qth
+ * contrib/hbqt/qtcore/qth/QByteArray.qth
+ * contrib/hbqt/qtcore/qth/QChar.qth
+ * contrib/hbqt/qtcore/qth/QDataStream.qth
+ * contrib/hbqt/qtcore/qth/QDate.qth
+ * contrib/hbqt/qtcore/qth/QDateTime.qth
+ * contrib/hbqt/qtcore/qth/QDir.qth
+ * contrib/hbqt/qtcore/qth/QEvent.qth
+ * contrib/hbqt/qtcore/qth/QEventLoop.qth
+ * contrib/hbqt/qtcore/qth/QFile.qth
+ * contrib/hbqt/qtcore/qth/QFileInfo.qth
+ * contrib/hbqt/qtcore/qth/QGenericArgument.qth
+ * contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth
+ * contrib/hbqt/qtcore/qth/QLatin1Char.qth
+ * contrib/hbqt/qtcore/qth/QLatin1String.qth
+ * contrib/hbqt/qtcore/qth/QLineF.qth
+ * contrib/hbqt/qtcore/qth/QList.qth
+ * contrib/hbqt/qtcore/qth/QLocale.qth
+ * contrib/hbqt/qtcore/qth/QMimeData.qth
+ * contrib/hbqt/qtcore/qth/QModelIndex.qth
+ * contrib/hbqt/qtcore/qth/QObject.qth
+ * contrib/hbqt/qtcore/qth/QRect.qth
+ * contrib/hbqt/qtcore/qth/QRectF.qth
+ * contrib/hbqt/qtcore/qth/QRegExp.qth
+ * contrib/hbqt/qtcore/qth/QResource.qth
+ * contrib/hbqt/qtcore/qth/QSettings.qth
+ * contrib/hbqt/qtcore/qth/QSignalMapper.qth
+ * contrib/hbqt/qtcore/qth/QSizeF.qth
+ * contrib/hbqt/qtcore/qth/QStringList.qth
+ * contrib/hbqt/qtcore/qth/QTextBoundaryFinder.qth
+ * contrib/hbqt/qtcore/qth/QTextCodec.qth
+ * contrib/hbqt/qtcore/qth/QTextDecoder.qth
+ * contrib/hbqt/qtcore/qth/QTextEncoder.qth
+ * contrib/hbqt/qtcore/qth/QTextStream.qth
+ * contrib/hbqt/qtcore/qth/QTime.qth
+ * contrib/hbqt/qtcore/qth/QTimeLine.qth
+ * contrib/hbqt/qtcore/qth/QTimer.qth
+ * contrib/hbqt/qtcore/qth/QTranslator.qth
+ * contrib/hbqt/qtcore/qth/QUrl.qth
+ * contrib/hbqt/qtcore/qth/QVariant.qth
+ ! Restructured: constructors.
+ This achieves 99% compatibility of Qt's constructor methods.
+
+ * contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
+ ! Minor.
+
+ * contrib/hbqt/qtcore/hbqt_pointer.cpp
+ + Added: hbqt_getObjectType( iParam );
+
2011-04-07 22:53 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbunix/hbposix.h
* harbour/contrib/hbunix/uidgid.c
diff --git a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp
index cfd308638a..3a89ba9bfb 100644
--- a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp
+++ b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp
@@ -343,6 +343,33 @@ int hbqt_isObjectType( int iParam, HB_U32 iType )
return HB_FALSE;
}
+HB_U32 hbqt_getObjectType( int iParam )
+{
+ PHB_ITEM pItem;
+
+ HB_TRACE( HB_TR_DEBUG, ( "hbqt_isObjectType( %d )", iParam ) );
+
+ if( ( pItem = hb_param( iParam, HB_IT_OBJECT ) ) != NULL )
+ {
+ hb_vmPushSymbol( hb_dynsymSymbol( hb_dynsymFindName( "PPTR" ) ) );
+ hb_vmPush( pItem );
+ hb_vmSend( 0 );
+
+ pItem = hb_param( -1, HB_IT_POINTER );
+
+ if( pItem )
+ {
+ HBQT_GC_T * p = ( HBQT_GC_T * ) hb_itemGetPtrGC( pItem, hbqt_gcFuncs() );
+
+ if( p && p->ph )
+ {
+ return p->type;
+ }
+ }
+ }
+ return 0;
+}
+
HB_FUNC( HBQT_ISOBJECT )
{
PHB_ITEM pParam = hb_param( 1, HB_IT_OBJECT );
diff --git a/harbour/contrib/hbqt/qtcore/qth/QBitArray.qth b/harbour/contrib/hbqt/qtcore/qth/QBitArray.qth
index c39d643ddb..dc68ea02b5 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QBitArray.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QBitArray.qth
@@ -28,7 +28,18 @@ New =
*/
HB_FUNC( QT_QBITARRAY )
{
- __HB_RETPTRGC__( new QBitArray() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QBitArray( *hbqt_par_QBitArray( 1 ) ) );
+ }
+ else if( hb_pcount() >= 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QBitArray( hb_parni( 1 ), HB_ISLOG( 2 ) ? hb_parl( 2 ) : false ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QBitArray() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QBuffer.qth b/harbour/contrib/hbqt/qtcore/qth/QBuffer.qth
index 54dacd95dd..9ed5d56151 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QBuffer.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QBuffer.qth
@@ -35,7 +35,14 @@ New =
*/
HB_FUNC( QT_QBUFFER )
{
- __HB_RETPTRGC__( new QBuffer() );
+ if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QBuffer( hbqt_par_QByteArray( 1 ), HB_ISOBJECT( 2 ) ? hbqt_par_QObject( 2 ) : 0 ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QBuffer( HB_ISOBJECT( 1 ) ? hbqt_par_QObject( 1 ) : 0 ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QByteArray.qth b/harbour/contrib/hbqt/qtcore/qth/QByteArray.qth
index 7ac03cc038..54ecb22cef 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QByteArray.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QByteArray.qth
@@ -32,10 +32,22 @@ ClubMethods = no
*/
HB_FUNC( QT_QBYTEARRAY )
{
- if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QByteArray( *hbqt_par_QByteArray( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
__HB_RETPTRGC__( new QByteArray( hb_parc( 1 ) ) );
}
+ else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) )
+ {
+ __HB_RETPTRGC__( new QByteArray( hb_parc( 1 ), hb_parni( 2 ) ) );
+ }
+ else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
+ {
+ __HB_RETPTRGC__( new QByteArray( hb_parni( 1 ), hb_parni( 2 ) ) );
+ }
else
{
__HB_RETPTRGC__( new QByteArray() );
diff --git a/harbour/contrib/hbqt/qtcore/qth/QChar.qth b/harbour/contrib/hbqt/qtcore/qth/QChar.qth
index d85ae27981..6382e4cfa3 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QChar.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QChar.qth
@@ -43,7 +43,18 @@ Destructor = no
*/
HB_FUNC( QT_QCHAR )
{
- __HB_RETPTRGC__( new QChar() );
+ if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QChar( *hbqt_par_QLatin1Char( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QChar( hb_parni( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QChar() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth
index 07e2e1c2eb..cd7037828b 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QDataStream.qth
@@ -31,7 +31,25 @@ Destructor =
*/
HB_FUNC( QT_QDATASTREAM )
{
- __HB_RETPTRGC__( new QDataStream() );
+ if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) )
+ {
+ if( hbqt_isObjectType( 1, HBQT_TYPE_QIODevice ) )
+ {
+ __HB_RETPTRGC__( new QDataStream( hbqt_par_QIODevice( 1 ) ) );
+ }
+ else if( hbqt_isObjectType( 1, HBQT_TYPE_QByteArray ) )
+ {
+ __HB_RETPTRGC__( new QDataStream( *hbqt_par_QByteArray( 1 ) ) );
+ }
+ }
+ if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISNUM( 2 ) )
+ {
+ __HB_RETPTRGC__( new QDataStream( hbqt_par_QByteArray( 1 ), ( QIODevice::OpenMode ) hb_parni( 2 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QDataStream() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QDate.qth b/harbour/contrib/hbqt/qtcore/qth/QDate.qth
index 612d770483..57564f9f05 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QDate.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QDate.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -28,7 +28,18 @@ Destructor =
*/
HB_FUNC( QT_QDATE )
{
- __HB_RETPTRGC__( new QDate() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QDate( *hbqt_par_QDate( 1 ) ) );
+ }
+ else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ))
+ {
+ __HB_RETPTRGC__( new QDate( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QDate() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth b/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth
index 496d2cd976..c3b56d2880 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QDateTime.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -31,7 +31,25 @@ New =
*/
HB_FUNC( QT_QDATETIME )
{
- __HB_RETPTRGC__( new QDateTime() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ if( hbqt_isObjectType( 1, HBQT_TYPE_QDate ) )
+ {
+ __HB_RETPTRGC__( new QDateTime( *hbqt_par_QDate( 1 ) ) );
+ }
+ else if( hbqt_isObjectType( 1, HBQT_TYPE_QDateTime ) )
+ {
+ __HB_RETPTRGC__( new QDateTime( *hbqt_par_QDateTime( 1 ) ) );
+ }
+ }
+ else if( hb_pcount() >= 2 && HB_ISOBJECT( 2 ) && HB_ISOBJECT( 3 ) )
+ {
+ __HB_RETPTRGC__( new QDateTime( *hbqt_par_QDate( 1 ), *hbqt_par_QTime( 2 ), HB_ISNUM( 3 ) ? ( Qt::TimeSpec ) hb_parni( 3 ) : Qt::LocalTime ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QDateTime() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QDir.qth b/harbour/contrib/hbqt/qtcore/qth/QDir.qth
index 5b2c971c40..fb05d6e705 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QDir.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QDir.qth
@@ -31,7 +31,18 @@ New = pParent
*/
HB_FUNC( QT_QDIR )
{
- __HB_RETPTRGC__( new QDir( hbqt_par_QString( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QDir( *hbqt_par_QDir( 1 ) ) );
+ }
+ else if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QDir( hbqt_par_QString( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QDir() );
+ }
}
@@ -51,8 +62,8 @@ bool cd ( const QString & dirName )
bool cdUp ()
uint count () const
QString dirName () const
-// QFileInfoList entryInfoList ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) const
-// QFileInfoList entryInfoList ( Filters filters = NoFilter, SortFlags sort = NoSort ) const
+QList< QFileInfo > entryInfoList ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) const
+QList< QFileInfo > entryInfoList ( Filters filters = NoFilter, SortFlags sort = NoSort ) const
QStringList entryList ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) const
QStringList entryList ( Filters filters = NoFilter, SortFlags sort = NoSort ) const
bool exists ( const QString & name ) const
@@ -85,7 +96,7 @@ void addSearchPath ( const QString & prefix, const QString & path )
QString cleanPath ( const QString & path )
QDir current ()
QString currentPath ()
-// QFileInfoList drives ()
+QList< QFileInfo > drives ()
QString fromNativeSeparators ( const QString & pathName )
QDir home ()
QString homePath ()
diff --git a/harbour/contrib/hbqt/qtcore/qth/QEvent.qth b/harbour/contrib/hbqt/qtcore/qth/QEvent.qth
index 57af3b986b..1a125c4ba8 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QEvent.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QEvent.qth
@@ -27,7 +27,14 @@ New = nType
*/
HB_FUNC( QT_QEVENT )
{
- __HB_RETPTRGC__( new QEvent( ( QEvent::Type ) hb_parni( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QEvent( *hbqt_par_QEvent( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QEvent( ( QEvent::Type ) hb_parni( 1 ) ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth b/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth
index 345408114d..80967070d0 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QEventLoop.qth
@@ -27,7 +27,10 @@ New = pObject
*/
HB_FUNC( QT_QEVENTLOOP )
{
- __HB_RETPTRGC__( new QEventLoop( hbqt_par_QObject( 1 ) ) );
+ if( hb_pcount() >= 0 )
+ {
+ __HB_RETPTRGC__( new QEventLoop( HB_ISOBJECT( 1 ) ? hbqt_par_QObject( 1 ) : 0 ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QFile.qth b/harbour/contrib/hbqt/qtcore/qth/QFile.qth
index 0030aad6f6..8bbfea5b09 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QFile.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QFile.qth
@@ -30,10 +30,29 @@ Destructor =
*/
HB_FUNC( QT_QFILE )
{
- if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ if( hbqt_isObjectType( 1, HBQT_TYPE_QFile ) )
+ {
+ __HB_RETPTRGC__( new QFile( hbqt_par_QFile( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QFile( hbqt_par_QObject( 1 ) ) );
+ }
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
__HB_RETPTRGC__( new QFile( hbqt_par_QString( 1 ) ) );
}
+ else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) )
+ {
+ __HB_RETPTRGC__( new QFile( hbqt_par_QString( 1 ), hbqt_par_QObject( 2 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QFile() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth b/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth
index d405a6364a..defec6c6be 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QFileInfo.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -34,7 +34,29 @@ Destructor =
*/
HB_FUNC( QT_QFILEINFO )
{
- __HB_RETPTRGC__( new QFileInfo() );
+ if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QFileInfo( hbqt_par_QString( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ if( hbqt_isObjectType( 1, HBQT_TYPE_QFile ) )
+ {
+ __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QFile( 1 ) ) );
+ }
+ else if( hbqt_isObjectType( 1, HBQT_TYPE_QFileInfo ) )
+ {
+ __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QFileInfo( 1 ) ) );
+ }
+ }
+ if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISCHAR( 2 ) )
+ {
+ __HB_RETPTRGC__( new QFileInfo( *hbqt_par_QDir( 1 ), hbqt_par_QString( 2 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QFileInfo() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth b/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth
index 334f9d2571..e7329a1c8e 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QGenericArgument.qth
@@ -14,7 +14,7 @@
QObject = NO
Inherits =
-Type =
+Type =
New =
@@ -30,15 +30,19 @@ New =
/*
* QGenericArgument ( const char * name = 0, const void * data = 0 )
- *
+ *
*/
HB_FUNC( QT_QGENERICARGUMENT )
{
- if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QGenericArgument( *hbqt_par_QGenericArgument( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
__HB_RETPTRGC__( new QGenericArgument( hb_parc( 1 ), 0 ) );
}
- else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) )
+ else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) )
{
__HB_RETPTRGC__( new QGenericArgument( hb_parc( 1 ), hb_parptr( 2 ) ) );
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth b/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth
index 60290ac02d..f196d31335 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QGenericReturnArgument.qth
@@ -14,7 +14,7 @@
QObject = no
Inherits = QGenericArgument
-Type =
+Type =
New =
@@ -30,15 +30,19 @@ New =
/*
* QGenericArgument ( const char * name = 0, const void * data = 0 )
- *
+ *
*/
HB_FUNC( QT_QGENERICRETURNARGUMENT )
{
- if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QGenericReturnArgument( *hbqt_par_QGenericReturnArgument( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
__HB_RETPTRGC__( new QGenericReturnArgument( hb_parc( 1 ), 0 ) );
}
- else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISOBJECT( 2 ) )
+ else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) )
{
__HB_RETPTRGC__( new QGenericReturnArgument( hb_parc( 1 ), hb_parptr( 2 ) ) );
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QLatin1Char.qth b/harbour/contrib/hbqt/qtcore/qth/QLatin1Char.qth
index 2bbe47d1e4..4be3578dea 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QLatin1Char.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QLatin1Char.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -27,7 +27,18 @@ New =
*/
HB_FUNC( QT_QLATIN1CHAR )
{
- __HB_RETPTRGC__( new QLatin1Char( *hb_parcx( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLatin1Char( *hbqt_par_QLatin1Char( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLatin1Char( *hb_parcx( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLatin1Char( ( char ) hb_parni( 1 ) ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QLatin1String.qth b/harbour/contrib/hbqt/qtcore/qth/QLatin1String.qth
index 2201423851..a09647b1f3 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QLatin1String.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QLatin1String.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -27,7 +27,14 @@ New =
*/
HB_FUNC( QT_QLATIN1STRING )
{
- __HB_RETPTRGC__( new QLatin1String( hb_parcx( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLatin1String( *hbqt_par_QLatin1String( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLatin1String( hb_parcx( 1 ) ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QLineF.qth b/harbour/contrib/hbqt/qtcore/qth/QLineF.qth
index eb6907e512..6f8faf9ece 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QLineF.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QLineF.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -30,7 +30,22 @@ Destructor =
*/
HB_FUNC( QT_QLINEF )
{
- __HB_RETPTRGC__( new QLineF() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLineF( *hbqt_par_QLineF( 1 ) ) );
+ }
+ else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) )
+ {
+ __HB_RETPTRGC__( new QLineF( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) );
+ }
+ else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) )
+ {
+ __HB_RETPTRGC__( new QLineF( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QLineF() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QList.qth b/harbour/contrib/hbqt/qtcore/qth/QList.qth
index 4c0619f26d..37626df393 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QList.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QList.qth
@@ -30,8 +30,15 @@ List = yes
*/
HB_FUNC( QT_QLIST )
{
- QList* list = NULL;
- __HB_RETPTRGC__( ( QList* ) list );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QList< void * >( *hbqt_par_QList( 1 ) ) );
+ }
+ else
+ {
+ QList< void * >* list = NULL;
+ __HB_RETPTRGC__( ( QList< void * >* ) list );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QLocale.qth b/harbour/contrib/hbqt/qtcore/qth/QLocale.qth
index 0995714a8a..15a42118bb 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QLocale.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QLocale.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -30,7 +30,22 @@ Destructor =
*/
HB_FUNC( QT_QLOCALE )
{
- __HB_RETPTRGC__( new QLocale() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLocale( *hbqt_par_QLocale( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLocale( hbqt_par_QString( 1 ) ) );
+ }
+ else if( hb_pcount() >= 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QLocale( ( QLocale::Language ) hb_parni( 1 ), HB_ISNUM( 2 ) ? ( QLocale::Country ) hb_parni( 2 ) : QLocale::AnyCountry ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QLocale() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QMimeData.qth b/harbour/contrib/hbqt/qtcore/qth/QMimeData.qth
index e35209be10..32b89214bd 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QMimeData.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QMimeData.qth
@@ -12,11 +12,11 @@
*/
-QObject =
+QObject =
Inherits = QObject
Type = Core
New =
-Destructor =
+Destructor =
@@ -29,7 +29,10 @@ Destructor =
*/
HB_FUNC( QT_QMIMEDATA )
{
- __HB_RETPTRGC__( new QMimeData() );
+ if( hb_pcount() == 0 )
+ {
+ __HB_RETPTRGC__( new QMimeData() );
+ }
}
@@ -59,7 +62,7 @@ void setUrls ( const QList & urls )
QString text () const
QList urls () const
-# Harbour Callable Function Till QList is not resolved
+# Harbour Callable Function Till QList is not resolved
#
QStringList * hbUrlList() const{
QMimeData * _mimedata = ( QMimeData * ) hbqt_pPtrFromObj( 0 );
diff --git a/harbour/contrib/hbqt/qtcore/qth/QModelIndex.qth b/harbour/contrib/hbqt/qtcore/qth/QModelIndex.qth
index 370c4fe960..d3d8021a8d 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QModelIndex.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QModelIndex.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -29,7 +29,14 @@ New =
*/
HB_FUNC( QT_QMODELINDEX )
{
- __HB_RETPTRGC__( new QModelIndex() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QModelIndex( *hbqt_par_QModelIndex( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QModelIndex() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QObject.qth b/harbour/contrib/hbqt/qtcore/qth/QObject.qth
index f14a389866..a2cd724b02 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QObject.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QObject.qth
@@ -26,7 +26,14 @@ Calls = QT_Qbject
*/
HB_FUNC( QT_QOBJECT )
{
- __HB_RETPTRGC__( new QObject( hbqt_par_QObject( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QObject( hbqt_par_QObject( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QObject( 0 ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QRect.qth b/harbour/contrib/hbqt/qtcore/qth/QRect.qth
index c71f410f5d..6be7c6746f 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QRect.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QRect.qth
@@ -14,7 +14,7 @@
QObject = no
Type = PlainObject
-New =
+New =
@@ -37,7 +37,14 @@ HB_FUNC( QT_QRECT )
}
else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) )
{
- __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) );
+ if( hbqt_isObjectType( 2, HBQT_TYPE_QPoint ) )
+ {
+ __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) );
+ }
+ if( hbqt_isObjectType( 2, HBQT_TYPE_QSize ) )
+ {
+ __HB_RETPTRGC__( new QRect( *hbqt_par_QPoint( 1 ), *hbqt_par_QSize( 2 ) ) );
+ }
}
else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) )
{
@@ -112,7 +119,7 @@ QRect translated ( const QPoint & offset ) const
QRect united ( const QRect & rectangle ) const
int width () const
int x () const
-int y () const
+int y () const
diff --git a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth
index 1c240c551f..d88ee0b5c1 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QRectF.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QRectF.qth
@@ -14,7 +14,7 @@
QObject = no
Type = PlainObject
-New =
+New =
@@ -37,7 +37,14 @@ HB_FUNC( QT_QRECTF )
}
else if( hb_pcount() == 2 && HB_ISOBJECT( 1 ) && HB_ISOBJECT( 2 ) )
{
- __HB_RETPTRGC__( new QRectF( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) );
+ if( hbqt_isObjectType( 2, HBQT_TYPE_QPointF ) )
+ {
+ __HB_RETPTRGC__( new QRectF( *hbqt_par_QPointF( 1 ), *hbqt_par_QPointF( 2 ) ) );
+ }
+ if( hbqt_isObjectType( 2, HBQT_TYPE_QSizeF ) )
+ {
+ __HB_RETPTRGC__( new QRectF( *hbqt_par_QPointF( 1 ), *hbqt_par_QSizeF( 2 ) ) );
+ }
}
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/QRegExp.qth b/harbour/contrib/hbqt/qtcore/qth/QRegExp.qth
index bb19717541..2a125271ec 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QRegExp.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QRegExp.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -30,7 +30,18 @@ Destructor =
*/
HB_FUNC( QT_QREGEXP )
{
- __HB_RETPTRGC__( new QRegExp() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QRegExp( *hbqt_par_QRegExp( 1 ) ) );
+ }
+ else if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QRegExp( hbqt_par_QString( 1 ), HB_ISNUM( 2 ) ? ( Qt::CaseSensitivity ) hb_parni( 2 ) : Qt::CaseSensitive, HB_ISNUM( 3 ) ? ( QRegExp::PatternSyntax ) hb_parni( 3 ) : QRegExp::RegExp ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QRegExp() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QResource.qth b/harbour/contrib/hbqt/qtcore/qth/QResource.qth
index fb44d092d2..f7217434f1 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QResource.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QResource.qth
@@ -30,7 +30,14 @@ ClubMethods = no
*/
HB_FUNC( QT_QRESOURCE )
{
- __HB_RETPTRGC__( new QResource() );
+ if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QResource( hbqt_par_QString( 1 ), HB_ISOBJECT( 2 ) ? *hbqt_par_QLocale( 2 ) : QLocale() ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QResource() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QSettings.qth b/harbour/contrib/hbqt/qtcore/qth/QSettings.qth
index 8aeb82b978..af8e978f37 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QSettings.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QSettings.qth
@@ -14,7 +14,7 @@
Inherits = QObject
Type = Core
-New =
+New =
@@ -33,11 +33,19 @@ HB_FUNC( QT_QSETTINGS )
{
if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) )
{
- __HB_RETPTRGC__( new QSettings( hbqt_par_QString( 1 ), hbqt_par_QString( 2 ), 0 ) );
+ __HB_RETPTRGC__( new QSettings( hbqt_par_QString( 1 ), hbqt_par_QString( 2 ), HB_ISOBJECT( 3 ) ? hbqt_par_QObject( 3 ) : 0 ) );
}
else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) )
{
- __HB_RETPTRGC__( new QSettings( hbqt_par_QString( 1 ), ( QSettings::Format ) hb_parni( 2 ) ) );
+ __HB_RETPTRGC__( new QSettings( hbqt_par_QString( 1 ), ( QSettings::Format ) hb_parni( 2 ), HB_ISOBJECT( 3 ) ? hbqt_par_QObject( 3 ) : 0 ) );
+ }
+ else if( hb_pcount() >= 2 && HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) )
+ {
+ __HB_RETPTRGC__( new QSettings( ( QSettings::Scope ) hb_parni( 1 ), hbqt_par_QString( 2 ), HB_ISCHAR( 3 ) ? hbqt_par_QString( 3 ) : QString(), HB_ISOBJECT( 4 ) ? hbqt_par_QObject( 4 ) : 0 ) );
+ }
+ else if( hb_pcount() >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISCHAR( 3 ) )
+ {
+ __HB_RETPTRGC__( new QSettings( ( QSettings::Format ) hb_parni( 1 ), ( QSettings::Scope ) hb_parni( 2 ), hbqt_par_QString( 3 ), HB_ISCHAR( 4 ) ? hbqt_par_QString( 4 ) : QString(), HB_ISOBJECT( 5 ) ? hbqt_par_QObject( 5 ) : 0 ) );
}
else
{
diff --git a/harbour/contrib/hbqt/qtcore/qth/QSignalMapper.qth b/harbour/contrib/hbqt/qtcore/qth/QSignalMapper.qth
index 31cc7bce47..fcda70ed6f 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QSignalMapper.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QSignalMapper.qth
@@ -26,19 +26,19 @@ New = pParent
*/
HB_FUNC( QT_QSIGNALMAPPER )
{
- __HB_RETPTRGC__( new QSignalMapper( hbqt_par_QObject( 1 ) ) );
+ __HB_RETPTRGC__( new QSignalMapper( HB_ISOBJECT( 1 ) ? hbqt_par_QObject( 1 ) : 0 ) );
}
QObject * mapping ( int id ) const
QObject * mapping ( const QString & id ) const
-// QObject * mapping ( QWidget * widget ) const
+QObject * mapping ( QWidget * widget ) const
QObject * mapping ( QObject * object ) const
void removeMappings ( QObject * sender )
void setMapping ( QObject * sender, int id )
void setMapping ( QObject * sender, const QString & text )
-// void setMapping ( QObject * sender, QWidget * widget )
+void setMapping ( QObject * sender, QWidget * widget )
void setMapping ( QObject * sender, QObject * object )
@@ -50,6 +50,6 @@ void map ( QObject * sender )
void mapped ( int i )
void mapped ( const QString & text )
-// void mapped ( QWidget * widget )
+void mapped ( QWidget * widget )
void mapped ( QObject * object )
diff --git a/harbour/contrib/hbqt/qtcore/qth/QSizeF.qth b/harbour/contrib/hbqt/qtcore/qth/QSizeF.qth
index f2c4bcbb1c..405a4216ee 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QSizeF.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QSizeF.qth
@@ -14,7 +14,7 @@
QObject = no
Type = PlainObject
-New =
+New =
@@ -33,6 +33,10 @@ HB_FUNC( QT_QSIZEF )
{
__HB_RETPTRGC__( new QSizeF( hb_parnd( 1 ), hb_parnd( 2 ) ) );
}
+ else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QSizeF( *hbqt_par_QSizeF( 1 ) ) );
+ }
else
{
__HB_RETPTRGC__( new QSizeF() );
diff --git a/harbour/contrib/hbqt/qtcore/qth/QStringList.qth b/harbour/contrib/hbqt/qtcore/qth/QStringList.qth
index ab7d76e3a0..5501fa2a79 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QStringList.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QStringList.qth
@@ -30,7 +30,18 @@ New =
*/
HB_FUNC( QT_QSTRINGLIST )
{
- __HB_RETPTRGC__( new QStringList() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QStringList( *hbqt_par_QStringList( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QStringList( hbqt_par_QString( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QStringList() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextBoundaryFinder.qth b/harbour/contrib/hbqt/qtcore/qth/QTextBoundaryFinder.qth
index 20e5aa21a6..9208aab045 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTextBoundaryFinder.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTextBoundaryFinder.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -31,7 +31,22 @@ New =
*/
HB_FUNC( QT_QTEXTBOUNDARYFINDER )
{
- __HB_RETPTRGC__( new QTextBoundaryFinder() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTextBoundaryFinder( *hbqt_par_QTextBoundaryFinder( 1 ) ) );
+ }
+ else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) )
+ {
+ __HB_RETPTRGC__( new QTextBoundaryFinder( ( QTextBoundaryFinder::BoundaryType ) hb_parni( 1 ), hbqt_par_QString( 2 ) ) );
+ }
+ else if( hb_pcount() >= 3 && HB_ISNUM( 1 ) && HB_ISOBJECT( 2 ) && HB_ISNUM( 3 ) )
+ {
+ __HB_RETPTRGC__( new QTextBoundaryFinder( ( QTextBoundaryFinder::BoundaryType ) hb_parni( 1 ), hbqt_par_QChar( 2 ), hb_parni( 3 ), HB_ISCHAR( 4 ) ? ( unsigned char * ) hb_parc( 4 ) : 0, hb_parni( 5 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QTextBoundaryFinder() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextCodec.qth b/harbour/contrib/hbqt/qtcore/qth/QTextCodec.qth
index edbe394376..7d60627c6c 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTextCodec.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTextCodec.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
Destructor = no
Constructor = no
@@ -51,7 +51,7 @@ virtual int mibEnum () const = 0
virtual QByteArray name () const = 0
QString toUnicode ( const QByteArray & a ) const
#
-// QString toUnicode ( const char * input, int size, ConverterState * state = 0 ) const
+//QString toUnicode ( const char * input, int size, ConverterState * state = 0 ) const
#
QString toUnicode ( const char * chars ) const
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextDecoder.qth b/harbour/contrib/hbqt/qtcore/qth/QTextDecoder.qth
index efcb56fe1a..d4adafc2b0 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTextDecoder.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTextDecoder.qth
@@ -13,7 +13,7 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New = pTextCodec
@@ -28,7 +28,10 @@ New = pTextCodec
*/
HB_FUNC( QT_QTEXTDECODER )
{
- __HB_RETPTRGC__( new QTextDecoder( hbqt_par_QTextCodec( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTextDecoder( hbqt_par_QTextCodec( 1 ) ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextEncoder.qth b/harbour/contrib/hbqt/qtcore/qth/QTextEncoder.qth
index f7734f4b90..3f7c7c87df 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTextEncoder.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTextEncoder.qth
@@ -13,9 +13,9 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
-New =
+New =
@@ -28,7 +28,10 @@ New =
*/
HB_FUNC( QT_QTEXTENCODER )
{
- __HB_RETPTRGC__( new QTextEncoder( hbqt_par_QTextCodec( 1 ) ) );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTextEncoder( hbqt_par_QTextCodec( 1 ) ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth b/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth
index f99a5e60f1..4f03eacc7e 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTextStream.qth
@@ -32,7 +32,25 @@ New = cText, nIOMode
*/
HB_FUNC( QT_QTEXTSTREAM )
{
- __HB_RETPTRGC__( new QTextStream( hb_parcx( 1 ), ( QIODevice::OpenMode ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : QIODevice::ReadWrite ) ) );
+ if( hb_pcount() >= 1 && HB_ISOBJECT( 1 ) )
+ {
+ if( hbqt_isObjectType( 1, HBQT_TYPE_QIODevice ) )
+ {
+ __HB_RETPTRGC__( new QTextStream( hbqt_par_QIODevice( 1 ) ) );
+ }
+ else if( hbqt_isObjectType( 1, HBQT_TYPE_QByteArray ) )
+ {
+ __HB_RETPTRGC__( new QTextStream( hbqt_par_QByteArray( 1 ), ( QIODevice::OpenMode ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : QIODevice::ReadWrite ) ) );
+ }
+ }
+ else if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTextStream( hb_parcx( 1 ), ( QIODevice::OpenMode ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : QIODevice::ReadWrite ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QTextStream() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTime.qth b/harbour/contrib/hbqt/qtcore/qth/QTime.qth
index 6abb8345b9..bb00d666c1 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTime.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTime.qth
@@ -13,10 +13,10 @@
QObject = no
-Inherits =
+Inherits =
Type = Core
New =
-Destructor =
+Destructor =
@@ -28,7 +28,18 @@ Destructor =
*/
HB_FUNC( QT_QTIME )
{
- __HB_RETPTRGC__( new QTime() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTime( *hbqt_par_QTime( 1 ) ) );
+ }
+ else if( hb_pcount() >= 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
+ {
+ __HB_RETPTRGC__( new QTime( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QTime() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTimeLine.qth b/harbour/contrib/hbqt/qtcore/qth/QTimeLine.qth
index ae4e7e3ca0..5e8a8b728b 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTimeLine.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTimeLine.qth
@@ -12,10 +12,10 @@
*/
-QObject =
+QObject =
Inherit = QObject
-Type =
-New =
+Type =
+New =
@@ -28,7 +28,14 @@ New =
*/
HB_FUNC( QT_QTIMELINE )
{
- __HB_RETPTRGC__( new QTimeLine() );
+ if( hb_pcount() >= 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTimeLine( hb_parni( 1 ), HB_ISOBJECT( 2 ) ? hbqt_par_QObject( 2 ) : 0 ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QTimeLine() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTimer.qth b/harbour/contrib/hbqt/qtcore/qth/QTimer.qth
index 5f997d9570..69b76cd36a 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTimer.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTimer.qth
@@ -26,7 +26,7 @@ New = pParent
*/
HB_FUNC( QT_QTIMER )
{
- __HB_RETPTRGC__( new QTimer( hbqt_par_QObject( 1 ) ) );
+ __HB_RETPTRGC__( new QTimer( HB_ISOBJECT( 1 ) ? hbqt_par_QObject( 1 ) : 0 ) );
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QTranslator.qth b/harbour/contrib/hbqt/qtcore/qth/QTranslator.qth
index 650463c35f..49a6977f94 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QTranslator.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QTranslator.qth
@@ -12,11 +12,11 @@
*/
-QObject =
+QObject =
Inherits = QObject
Type = Core
New =
-Destructor =
+Destructor =
@@ -28,7 +28,14 @@ Destructor =
*/
HB_FUNC( QT_QTRANSLATOR )
{
- __HB_RETPTRGC__( new QTranslator() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ __HB_RETPTRGC__( new QTranslator( hbqt_par_QTranslator( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QTranslator( HB_ISOBJECT( 1 ) ? hbqt_par_QObject( 1 ) : 0 ) );
+ }
}
diff --git a/harbour/contrib/hbqt/qtcore/qth/QUrl.qth b/harbour/contrib/hbqt/qtcore/qth/QUrl.qth
index 5876912e18..ffeb20a051 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QUrl.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QUrl.qth
@@ -39,6 +39,10 @@ HB_FUNC( QT_QURL )
{
__HB_RETPTRGC__( new QUrl( *hbqt_par_QUrl( 1 ) ) );
}
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) )
+ {
+ __HB_RETPTRGC__( new QUrl( hbqt_par_QString( 1 ), ( QUrl::ParsingMode ) hb_parni( 2 ) ) );
+ }
else
{
__HB_RETPTRGC__( new QUrl() );
diff --git a/harbour/contrib/hbqt/qtcore/qth/QVariant.qth b/harbour/contrib/hbqt/qtcore/qth/QVariant.qth
index 6f8569251c..b3f8c248e2 100644
--- a/harbour/contrib/hbqt/qtcore/qth/QVariant.qth
+++ b/harbour/contrib/hbqt/qtcore/qth/QVariant.qth
@@ -69,7 +69,107 @@ QVariant ( const QRegExp & regExp )
*/
HB_FUNC( QT_QVARIANT )
{
- __HB_RETPTRGC__( new QVariant() );
+ if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
+ {
+ HB_U32 iType = hbqt_getObjectType( 1 );
+
+ if( iType == HBQT_TYPE_QVariant )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QVariant( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QByteArray )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QByteArray( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QBitArray )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QBitArray( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QLatin1String )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QLatin1String( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QStringList )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QStringList( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QDate )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QDate( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QTime )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QTime( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QDateTime )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QDateTime( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QChar )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QChar( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QSize )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QSize( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QSizeF )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QSizeF( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QRect )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QRect( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QRectF )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QRectF( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QPoint )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QPoint( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QPointF )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QPointF( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QLine )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QLine( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QLineF )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QLineF( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QUrl )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QUrl( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QLocale )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QLocale( 1 ) ) );
+ }
+ else if( iType == HBQT_TYPE_QRegExp )
+ {
+ __HB_RETPTRGC__( new QVariant( *hbqt_par_QRegExp( 1 ) ) );
+ }
+ }
+ else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+ {
+ __HB_RETPTRGC__( new QVariant( hbqt_par_QString( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+ {
+ __HB_RETPTRGC__( new QVariant( hb_parni( 1 ) ) );
+ }
+ else if( hb_pcount() == 1 && HB_ISLOG( 1 ) )
+ {
+ __HB_RETPTRGC__( new QVariant( hb_parl( 1 ) ) );
+ }
+ else
+ {
+ __HB_RETPTRGC__( new QVariant() );
+ }
}
diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
index c40b6e26dd..7b9d0c0cb9 100644
--- a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
+++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
@@ -116,11 +116,11 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2
if( p->type == HBQT_TYPE_QBrush )
vv = * ( ( QBrush * ) ( p->ph ) );
else if( p->type == HBQT_TYPE_QColor )
- vv = QColor( * ( ( QColor * ) ( p->ph ) ) );
+ vv = * ( ( QColor * ) ( p->ph ) ) );
else if( p->type == HBQT_TYPE_QSize )
vv = * ( ( QSize * ) ( p->ph ) );
else if( p->type == HBQT_TYPE_QIcon )
- vv = QIcon( * ( ( QIcon * ) ( p->ph ) ) );
+ vv = * ( ( QIcon * ) ( p->ph ) ) );
else if( p->type == HBQT_TYPE_QPixmap )
vv = * ( ( QPixmap * ) ( p->ph ) );
else if( p->type == HBQT_TYPE_QFont )
@@ -211,3 +211,4 @@ void HBQAbstractItemModel::reset()
}
#endif
+