diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7bfd72c8fe..e4763a6209 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,72 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-08 16:50 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/hbqt.ch + + * harbour/contrib/hbqt/QBitmap.cpp + * harbour/contrib/hbqt/QBrush.cpp + * harbour/contrib/hbqt/QCursor.cpp + * harbour/contrib/hbqt/QImage.cpp + * harbour/contrib/hbqt/QLine.cpp + * harbour/contrib/hbqt/QLinearGradient.cpp + * harbour/contrib/hbqt/QPicture.cpp + * harbour/contrib/hbqt/QPixmap.cpp + * harbour/contrib/hbqt/QPoint.cpp + * harbour/contrib/hbqt/QPointF.cpp + * harbour/contrib/hbqt/QRadialGradient.cpp + * harbour/contrib/hbqt/QRect.cpp + * harbour/contrib/hbqt/QRectF.cpp + * harbour/contrib/hbqt/QRegion.cpp + * harbour/contrib/hbqt/QSizeF.cpp + + * harbour/contrib/hbqt/TQBitmap.prg + * harbour/contrib/hbqt/TQImage.prg + * harbour/contrib/hbqt/TQLine.prg + * harbour/contrib/hbqt/TQLinearGradient.prg + * harbour/contrib/hbqt/TQPicture.prg + * harbour/contrib/hbqt/TQPixmap.prg + * harbour/contrib/hbqt/TQPoint.prg + * harbour/contrib/hbqt/TQPointF.prg + * harbour/contrib/hbqt/TQRadialGradient.prg + * harbour/contrib/hbqt/TQRect.prg + * harbour/contrib/hbqt/TQRectF.prg + * harbour/contrib/hbqt/TQRegion.prg + * harbour/contrib/hbqt/TQSizeF.prg + + * harbour/contrib/hbqt/qth/QBitmap.qth + * harbour/contrib/hbqt/qth/QBrush.qth + * harbour/contrib/hbqt/qth/QCursor.qth + * harbour/contrib/hbqt/qth/QImage.qth + * harbour/contrib/hbqt/qth/QLine.qth + * harbour/contrib/hbqt/qth/QLinearGradient.qth + * harbour/contrib/hbqt/qth/QPalette.qth + * harbour/contrib/hbqt/qth/QPicture.qth + * harbour/contrib/hbqt/qth/QPixmap.qth + * harbour/contrib/hbqt/qth/QPoint.qth + * harbour/contrib/hbqt/qth/QPointF.qth + * harbour/contrib/hbqt/qth/QRadialGradient.qth + * harbour/contrib/hbqt/qth/QRect.qth + * harbour/contrib/hbqt/qth/QRectF.qth + * harbour/contrib/hbqt/qth/QRegion.qth + * harbour/contrib/hbqt/qth/QSizeF.qth + + ! Updated for exact constructor parameters. + If the constructor accepts parameters with identical .prg supplied values, + a new parameter is inserted as a first argument and then resolved in .cpp. + + oBrush := QBrush():new( "QPixmap" , pQPixmap ) + oBrush := QBrush():new( "QImage" , pQImage ) + oBrush := QBrush():new( "QGradient", pQGradient ) + + Note that constructor fetches only one argument, a pointer to relevant + object, which at prg to cpp level can never be differed so this + mechanism was necessary. The first parameter will be matched exact + and hence it is case sensitive. If this parameter is of the same type + object is being created then it call will only supply pointer: + + oBrush := QBrush():new( pQBrush_other ) + 2009-07-08 22:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added -[no]ignore option which tells hbmk2 to ignore diff --git a/harbour/contrib/hbqt/QBitmap.cpp b/harbour/contrib/hbqt/QBitmap.cpp index bfe5c3afe2..7abb879acb 100644 --- a/harbour/contrib/hbqt/QBitmap.cpp +++ b/harbour/contrib/hbqt/QBitmap.cpp @@ -73,7 +73,41 @@ */ HB_FUNC( QT_QBITMAP ) { - hb_retptr( ( QBitmap* ) new QBitmap() ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( *hbqt_par_QBitmap( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( hbqt_par_QString( 1 ), ( const char * ) 0 ) ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( hbqt_par_QString( 1 ), hb_parc( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( hb_parni( 1 ), hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + if( ( QString ) "QPixmap" == hbqt_par_QString( 1 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( *hbqt_par_QPixmap( 1 ) ) ); + } + else if( ( QString ) "QSize" == hbqt_par_QString( 1 ) ) + { + hb_retptr( ( QBitmap* ) new QBitmap( *hbqt_par_QSize( 1 ) ) ); + } + else + { + hb_retptr( ( QBitmap* ) new QBitmap() ); + } + } + else + { + hb_retptr( ( QBitmap* ) new QBitmap() ); + } } /* diff --git a/harbour/contrib/hbqt/QBrush.cpp b/harbour/contrib/hbqt/QBrush.cpp index 1e97d23465..c92423ff0c 100644 --- a/harbour/contrib/hbqt/QBrush.cpp +++ b/harbour/contrib/hbqt/QBrush.cpp @@ -80,36 +80,7 @@ HB_FUNC( QT_QBRUSH ) { if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QPixmap( 1 ) ) ); - - #if 0 /* ToDO */ - QString objName = hbqt_par_QObject( 1 )->objectName(); - - if( objName == ( QString ) "QPixmap" ) - { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QPixmap( 1 ) ) ); - } - else if( objName == ( QString ) "QImage" ) - { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QImage( 1 ) ) ); - } - else if( objName == ( QString ) "QBrush" ) - { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QBrush( 1 ) ) ); - } - else if( objName == ( QString ) "QGradient" ) - { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QGradient( 1 ) ) ); - } - else if( objName == ( QString ) "QColor" ) - { - hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), Qt::SolidPattern ) ); - } - else - { - hb_retptr( ( QBrush* ) new QBrush() ); - } - #endif + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QBrush( 1 ) ) ); } else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { @@ -131,6 +102,32 @@ HB_FUNC( QT_QBRUSH ) { hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ); } + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + QString objName = hbqt_par_QString( 1 ); + + if( objName == ( QString ) "QPixmap" ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QPixmap( 1 ) ) ); + } + else if( objName == ( QString ) "QImage" ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QImage( 1 ) ) ); + } + else if( objName == ( QString ) "QGradient" ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QGradient( 1 ) ) ); + } + else if( objName == ( QString ) "QColor" ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), + HB_ISNUM( 3 ) ? ( Qt::BrushStyle ) hb_parni( 3 ) : Qt::SolidPattern ) ); + } + else + { + hb_retptr( ( QBrush* ) new QBrush() ); + } + } else { hb_retptr( ( QBrush* ) new QBrush() ); diff --git a/harbour/contrib/hbqt/QCursor.cpp b/harbour/contrib/hbqt/QCursor.cpp index b5937cc23e..9d3b99c78b 100644 --- a/harbour/contrib/hbqt/QCursor.cpp +++ b/harbour/contrib/hbqt/QCursor.cpp @@ -63,7 +63,6 @@ #include #include - /* * QCursor () * QCursor ( Qt::CursorShape shape ) @@ -82,24 +81,22 @@ HB_FUNC( QT_QCURSOR ) } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QPixmap( 1 ), -1, -1 ) ); - - #if 0 /* TODO */ - QString objName = hbqt_par_QObject( 1 )->objectName(); + hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QCursor( 1 ) ) ); + } + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + QString objName = hbqt_par_QString( 1 ); if( objName == ( QString ) "QPixmap" ) { - hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QPixmap( 1 ), -1, -1 ) ); - } - else if( objName == ( QString ) "QCursor" ) - { - hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QCursor( 1 ) ) ); + hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QPixmap( 2 ), + HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1, + HB_ISNUM( 4 ) ? hb_parni( 4 ) : -1 ) ); } else { hb_retptr( ( QCursor* ) new QCursor() ); } - #endif } else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) { @@ -107,11 +104,6 @@ HB_FUNC( QT_QCURSOR ) HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1, HB_ISNUM( 4 ) ? hb_parni( 4 ) : -1 ) ); } - else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) - { - hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QPixmap( 1 ), hb_parni( 2 ), - HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1 ) ); - } else { hb_retptr( ( QCursor* ) new QCursor() ); diff --git a/harbour/contrib/hbqt/QImage.cpp b/harbour/contrib/hbqt/QImage.cpp index 7b9b3d8f70..43bab04400 100644 --- a/harbour/contrib/hbqt/QImage.cpp +++ b/harbour/contrib/hbqt/QImage.cpp @@ -91,7 +91,38 @@ */ HB_FUNC( QT_QIMAGE ) { - hb_retptr( ( QImage* ) new QImage() ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QImage* ) new QImage( *hbqt_par_QImage( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + hb_retptr( ( QImage* ) new QImage( hbqt_par_QString( 1 ), ( const char * ) 0 ) ); + } + else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) ) + { + hb_retptr( ( QImage* ) new QImage( hbqt_par_QString( 1 ), ( const char * ) hb_parcx( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QImage* ) new QImage( *hbqt_par_QSize( 1 ), ( QImage::Format ) hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) + { + hb_retptr( ( QImage* ) new QImage( hb_parni( 1 ), hb_parni( 2 ), ( QImage::Format ) hb_parni( 3 ) ) ); + } + else if( hb_pcount() == 4 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) + { + hb_retptr( ( QImage* ) new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( QImage::Format ) hb_parni( 4 ) ) ); + } + else if( hb_pcount() == 5 && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) + { + hb_retptr( ( QImage* ) new QImage( ( const uchar * ) hb_parc( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( QImage::Format ) hb_parni( 5 ) ) ); + } + else + { + hb_retptr( ( QImage* ) new QImage() ); + } } /* diff --git a/harbour/contrib/hbqt/QLine.cpp b/harbour/contrib/hbqt/QLine.cpp index a26f0335c6..389e814274 100644 --- a/harbour/contrib/hbqt/QLine.cpp +++ b/harbour/contrib/hbqt/QLine.cpp @@ -70,7 +70,22 @@ */ HB_FUNC( QT_QLINE ) { - hb_retptr( ( QLine* ) new QLine() ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QLine* ) new QLine( *hbqt_par_QLine( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QLine* ) new QLine( *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_retptr( ( QLine* ) new QLine( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); + } + else + { + hb_retptr( ( QLine* ) new QLine() ); + } } /* diff --git a/harbour/contrib/hbqt/QLinearGradient.cpp b/harbour/contrib/hbqt/QLinearGradient.cpp index 9d25346ffc..e856d61f2d 100644 --- a/harbour/contrib/hbqt/QLinearGradient.cpp +++ b/harbour/contrib/hbqt/QLinearGradient.cpp @@ -70,7 +70,22 @@ */ HB_FUNC( QT_QLINEARGRADIENT ) { - hb_retptr( ( QLinearGradient* ) new QLinearGradient() ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QLinearGradient* ) new QLinearGradient( *hbqt_par_QLinearGradient( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QLinearGradient* ) new QLinearGradient( *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_retptr( ( QLinearGradient* ) new QLinearGradient( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ) ) ); + } + else + { + hb_retptr( ( QLinearGradient* ) new QLinearGradient() ); + } } /* diff --git a/harbour/contrib/hbqt/QPicture.cpp b/harbour/contrib/hbqt/QPicture.cpp index 3935f93c6f..23e415e1b7 100644 --- a/harbour/contrib/hbqt/QPicture.cpp +++ b/harbour/contrib/hbqt/QPicture.cpp @@ -70,7 +70,18 @@ */ HB_FUNC( QT_QPICTURE ) { - hb_retptr( ( QPicture* ) new QPicture() ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + hb_retptr( ( QPicture* ) new QPicture( hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QPicture* ) new QPicture( *hbqt_par_QPicture( 1 ) ) ); + } + else + { + hb_retptr( ( QPicture* ) new QPicture() ); + } } /* diff --git a/harbour/contrib/hbqt/QPixmap.cpp b/harbour/contrib/hbqt/QPixmap.cpp index bffa476d75..f5621a6b10 100644 --- a/harbour/contrib/hbqt/QPixmap.cpp +++ b/harbour/contrib/hbqt/QPixmap.cpp @@ -74,14 +74,18 @@ */ HB_FUNC( QT_QPIXMAP ) { - if( hb_pcount() >= 1 && HB_ISCHAR( 1 ) ) + if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) { hb_retptr( ( QPixmap* ) new QPixmap( hbqt_par_QString( 1 ), ( const char * ) 0, Qt::AutoColor ) ); } - else if( hb_pcount() >= 1 && HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { hb_retptr( ( QPixmap* ) new QPixmap( *hbqt_par_QPixmap( 1 ) ) ); } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QPixmap* ) new QPixmap( hb_parni( 1 ), hb_parni( 2 ) ) ); + } else { hb_retptr( ( QPixmap* ) new QPixmap() ); diff --git a/harbour/contrib/hbqt/QPoint.cpp b/harbour/contrib/hbqt/QPoint.cpp index a93d90c850..e490df6696 100644 --- a/harbour/contrib/hbqt/QPoint.cpp +++ b/harbour/contrib/hbqt/QPoint.cpp @@ -69,7 +69,18 @@ */ HB_FUNC( QT_QPOINT ) { - hb_retptr( ( QPoint* ) new QPoint( hb_parni( 1 ), hb_parni( 2 ) ) ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QPoint* ) new QPoint( hb_parni( 1 ), hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QPoint* ) new QPoint( *hbqt_par_QPoint( 1 ) ) ); + } + else + { + hb_retptr( ( QPoint* ) new QPoint() ); + } } /* diff --git a/harbour/contrib/hbqt/QPointF.cpp b/harbour/contrib/hbqt/QPointF.cpp index 514b23628d..7c92d94d28 100644 --- a/harbour/contrib/hbqt/QPointF.cpp +++ b/harbour/contrib/hbqt/QPointF.cpp @@ -70,8 +70,18 @@ */ HB_FUNC( QT_QPOINTF ) { - hb_retptr( ( QPointF* ) new QPointF( ( qreal ) hb_parnd( 1 ), - ( qreal ) hb_parnd( 2 ) ) ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QPointF* ) new QPointF( ( qreal ) hb_parnd( 1 ), ( qreal ) hb_parnd( 2 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QPointF* ) new QPointF( *hbqt_par_QPoint( 1 ) ) ); + } + else + { + hb_retptr( ( QPointF* ) new QPointF() ); + } } /* diff --git a/harbour/contrib/hbqt/QRadialGradient.cpp b/harbour/contrib/hbqt/QRadialGradient.cpp index 07458d909c..ea8a402c5d 100644 --- a/harbour/contrib/hbqt/QRadialGradient.cpp +++ b/harbour/contrib/hbqt/QRadialGradient.cpp @@ -72,7 +72,26 @@ */ HB_FUNC( QT_QRADIALGRADIENT ) { - hb_retptr( ( QRadialGradient* ) new QRadialGradient() ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QRadialGradient* ) new QRadialGradient( *hbqt_par_QRadialGradient( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QRadialGradient* ) new QRadialGradient( *hbqt_par_QPointF( 1 ), hb_parnd( 2 ) ) ); + } + else if( hb_pcount() == 3 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) ) + { + hb_retptr( ( QRadialGradient* ) new QRadialGradient( *hbqt_par_QPointF( 1 ), hb_parnd( 2 ), *hbqt_par_QPointF( 3 ) ) ); + } + else if( hb_pcount() == 5 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) ) + { + hb_retptr( ( QRadialGradient* ) new QRadialGradient( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) ) ); + } + else + { + hb_retptr( ( QRadialGradient* ) new QRadialGradient() ); + } } /* diff --git a/harbour/contrib/hbqt/QRect.cpp b/harbour/contrib/hbqt/QRect.cpp index 05201c06cf..f43cb53b0b 100644 --- a/harbour/contrib/hbqt/QRect.cpp +++ b/harbour/contrib/hbqt/QRect.cpp @@ -71,7 +71,22 @@ */ HB_FUNC( QT_QRECT ) { - hb_retptr( ( QRect* ) new QRect( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QRect* ) new QRect( *hbqt_par_QRect( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QRect* ) new QRect( *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_retptr( ( QRect* ) new QRect( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); + } + else + { + hb_retptr( ( QRect* ) new QRect() ); + } } /* diff --git a/harbour/contrib/hbqt/QRectF.cpp b/harbour/contrib/hbqt/QRectF.cpp index 04d47aace8..d2ff6851cc 100644 --- a/harbour/contrib/hbqt/QRectF.cpp +++ b/harbour/contrib/hbqt/QRectF.cpp @@ -72,10 +72,22 @@ */ HB_FUNC( QT_QRECTF ) { - hb_retptr( ( QRectF* ) new QRectF( ( qreal ) hb_parnd( 1 ), - ( qreal ) hb_parnd( 2 ), - ( qreal ) hb_parnd( 3 ), - ( qreal ) hb_parnd( 4 ) ) ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QRectF* ) new QRectF( *hbqt_par_QRectF( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QRectF* ) new QRectF( *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_retptr( ( QRectF* ) new QRectF( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ) ) ); + } + else + { + hb_retptr( ( QRectF* ) new QRectF() ); + } } /* diff --git a/harbour/contrib/hbqt/QRegion.cpp b/harbour/contrib/hbqt/QRegion.cpp index 242aca33d5..009f56ef7e 100644 --- a/harbour/contrib/hbqt/QRegion.cpp +++ b/harbour/contrib/hbqt/QRegion.cpp @@ -82,9 +82,44 @@ */ HB_FUNC( QT_QREGION ) { - hb_retptr( ( QRegion* ) new QRegion( hb_parni( 1 ), hb_parni( 2 ), - hb_parni( 3 ), hb_parni( 4 ), - ( QRegion::RegionType ) ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : QRegion::Rectangle ) ) ); + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( *hbqt_par_QRegion( 1 ) ) ); + } + else if( hb_pcount() >= 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), + HB_ISNUM( 5 ) ? ( QRegion::RegionType ) hb_parni( 5 ) : QRegion::Rectangle ) ); + } + else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) ) + { + if( ( QString ) "QPolygon" == hbqt_par_QString( 1 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( *hbqt_par_QPolygon( 2 ), + HB_ISNUM( 3 ) ? ( Qt::FillRule ) hb_parni( 3 ) : Qt::OddEvenFill ) ); + } + else if( ( QString ) "QBitmap" == hbqt_par_QString( 1 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( *hbqt_par_QBitmap( 2 ) ) ); + } + else if( ( QString ) "QRect" == hbqt_par_QString( 1 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( *hbqt_par_QRect( 2 ), + HB_ISNUM( 3 ) ? ( QRegion::RegionType ) hb_parni( 3 ) : QRegion::Rectangle ) ); + } + else + { + hb_retptr( ( QRegion* ) new QRegion() ); + } + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QRegion* ) new QRegion( *hbqt_par_QRect( 1 ), ( QRegion::RegionType ) hb_parni( 2 ) ) ); + } + else + { + hb_retptr( ( QRegion* ) new QRegion() ); + } } /* diff --git a/harbour/contrib/hbqt/QSizeF.cpp b/harbour/contrib/hbqt/QSizeF.cpp index 4280a4439c..9730433f54 100644 --- a/harbour/contrib/hbqt/QSizeF.cpp +++ b/harbour/contrib/hbqt/QSizeF.cpp @@ -67,12 +67,33 @@ * QSizeF () * QSizeF ( const QSize & size ) * QSizeF ( qreal width, qreal height ) - * QSizeF boundedTo ( const QSizeF & otherSize ) const - * QSizeF expandedTo ( const QSizeF & otherSize ) const */ HB_FUNC( QT_QSIZEF ) { - hb_retptr( ( QSizeF* ) new QSizeF( hb_parnd( 1 ), hb_parnd( 2 ) ) ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QSizeF* ) new QSizeF( hb_parnd( 1 ), hb_parnd( 2 ) ) ); + } + else + { + hb_retptr( ( QSizeF* ) new QSizeF() ); + } + } + +/* + * QSizeF boundedTo ( const QSizeF & otherSize ) const + */ +HB_FUNC( QT_QSIZEF_BOUNDEDTO ) +{ + hb_retptr( new QSizeF( hbqt_par_QSizeF( 1 )->boundedTo( *hbqt_par_QSizeF( 2 ) ) ) ); +} + +/* + * QSizeF expandedTo ( const QSizeF & otherSize ) const + */ +HB_FUNC( QT_QSIZEF_EXPANDEDTO ) +{ + hb_retptr( new QSizeF( hbqt_par_QSizeF( 1 )->expandedTo( *hbqt_par_QSizeF( 2 ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/TQBitmap.prg b/harbour/contrib/hbqt/TQBitmap.prg index 342f94ff09..f48110aa5a 100644 --- a/harbour/contrib/hbqt/TQBitmap.prg +++ b/harbour/contrib/hbqt/TQBitmap.prg @@ -72,11 +72,9 @@ CREATE CLASS QBitmap INHERIT QPixmap /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QBitmap +METHOD New( ... ) CLASS QBitmap - ::pParent := pParent - - ::pPtr := Qt_QBitmap( pParent ) + ::pPtr := Qt_QBitmap( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQImage.prg b/harbour/contrib/hbqt/TQImage.prg index b1e37020b1..3e5bf1f8d3 100644 --- a/harbour/contrib/hbqt/TQImage.prg +++ b/harbour/contrib/hbqt/TQImage.prg @@ -128,11 +128,9 @@ CREATE CLASS QImage /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QImage +METHOD New( ... ) CLASS QImage - ::pParent := pParent - - ::pPtr := Qt_QImage( pParent ) + ::pPtr := Qt_QImage( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQLine.prg b/harbour/contrib/hbqt/TQLine.prg index 7ec3ec357a..9be92000ea 100644 --- a/harbour/contrib/hbqt/TQLine.prg +++ b/harbour/contrib/hbqt/TQLine.prg @@ -85,11 +85,9 @@ CREATE CLASS QLine /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QLine +METHOD New( ... ) CLASS QLine - ::pParent := pParent - - ::pPtr := Qt_QLine( pParent ) + ::pPtr := Qt_QLine( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQLinearGradient.prg b/harbour/contrib/hbqt/TQLinearGradient.prg index e06e48dc0f..dfa13a2bcd 100644 --- a/harbour/contrib/hbqt/TQLinearGradient.prg +++ b/harbour/contrib/hbqt/TQLinearGradient.prg @@ -74,11 +74,9 @@ CREATE CLASS QLinearGradient INHERIT QGradient /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QLinearGradient +METHOD New( ... ) CLASS QLinearGradient - ::pParent := pParent - - ::pPtr := Qt_QLinearGradient( pParent ) + ::pPtr := Qt_QLinearGradient( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQPicture.prg b/harbour/contrib/hbqt/TQPicture.prg index b5dfcdbd3e..834ec6ee17 100644 --- a/harbour/contrib/hbqt/TQPicture.prg +++ b/harbour/contrib/hbqt/TQPicture.prg @@ -79,11 +79,9 @@ CREATE CLASS QPicture INHERIT QPaintDevice /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPicture +METHOD New( ... ) CLASS QPicture - ::pParent := pParent - - ::pPtr := Qt_QPicture( pParent ) + ::pPtr := Qt_QPicture( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQPixmap.prg b/harbour/contrib/hbqt/TQPixmap.prg index 2b74630731..05d1d94c0b 100644 --- a/harbour/contrib/hbqt/TQPixmap.prg +++ b/harbour/contrib/hbqt/TQPixmap.prg @@ -108,11 +108,9 @@ CREATE CLASS QPixmap INHERIT QPaintDevice /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPixmap +METHOD New( ... ) CLASS QPixmap - ::pParent := pParent - - ::pPtr := Qt_QPixmap( pParent ) + ::pPtr := Qt_QPixmap( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQPoint.prg b/harbour/contrib/hbqt/TQPoint.prg index 724384cfa0..92c6ee5150 100644 --- a/harbour/contrib/hbqt/TQPoint.prg +++ b/harbour/contrib/hbqt/TQPoint.prg @@ -76,11 +76,9 @@ CREATE CLASS QPoint /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPoint +METHOD New( ... ) CLASS QPoint - ::pParent := pParent - - ::pPtr := Qt_QPoint( pParent ) + ::pPtr := Qt_QPoint( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQPointF.prg b/harbour/contrib/hbqt/TQPointF.prg index e8bdafb92d..7451eeed8c 100644 --- a/harbour/contrib/hbqt/TQPointF.prg +++ b/harbour/contrib/hbqt/TQPointF.prg @@ -76,11 +76,9 @@ CREATE CLASS QPointF /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPointF +METHOD New( ... ) CLASS QPointF - ::pParent := pParent - - ::pPtr := Qt_QPointF( pParent ) + ::pPtr := Qt_QPointF( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQRadialGradient.prg b/harbour/contrib/hbqt/TQRadialGradient.prg index c00995cd5c..bc8b7d8419 100644 --- a/harbour/contrib/hbqt/TQRadialGradient.prg +++ b/harbour/contrib/hbqt/TQRadialGradient.prg @@ -76,11 +76,9 @@ CREATE CLASS QRadialGradient INHERIT QGradient /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QRadialGradient +METHOD New( ... ) CLASS QRadialGradient - ::pParent := pParent - - ::pPtr := Qt_QRadialGradient( pParent ) + ::pPtr := Qt_QRadialGradient( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQRect.prg b/harbour/contrib/hbqt/TQRect.prg index 663d7fe78a..bd4e139ab6 100644 --- a/harbour/contrib/hbqt/TQRect.prg +++ b/harbour/contrib/hbqt/TQRect.prg @@ -127,11 +127,9 @@ CREATE CLASS QRect /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QRect +METHOD New( ... ) CLASS QRect - ::pParent := pParent - - ::pPtr := Qt_QRect( pParent ) + ::pPtr := Qt_QRect( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQRectF.prg b/harbour/contrib/hbqt/TQRectF.prg index c2a773fd71..76c698ab4c 100644 --- a/harbour/contrib/hbqt/TQRectF.prg +++ b/harbour/contrib/hbqt/TQRectF.prg @@ -128,11 +128,9 @@ CREATE CLASS QRectF /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QRectF +METHOD New( ... ) CLASS QRectF - ::pParent := pParent - - ::pPtr := Qt_QRectF( pParent ) + ::pPtr := Qt_QRectF( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQRegion.prg b/harbour/contrib/hbqt/TQRegion.prg index a5d75b10a9..9315d7de2b 100644 --- a/harbour/contrib/hbqt/TQRegion.prg +++ b/harbour/contrib/hbqt/TQRegion.prg @@ -86,11 +86,9 @@ CREATE CLASS QRegion /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QRegion +METHOD New( ... ) CLASS QRegion - ::pParent := pParent - - ::pPtr := Qt_QRegion( pParent ) + ::pPtr := Qt_QRegion( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/TQSizeF.prg b/harbour/contrib/hbqt/TQSizeF.prg index 3aac97f9e1..908014e5e2 100644 --- a/harbour/contrib/hbqt/TQSizeF.prg +++ b/harbour/contrib/hbqt/TQSizeF.prg @@ -63,6 +63,8 @@ CREATE CLASS QSizeF METHOD New() + METHOD boundedTo( pOtherSize ) INLINE Qt_QSizeF_boundedTo( ::pPtr, pOtherSize ) + METHOD expandedTo( pOtherSize ) INLINE Qt_QSizeF_expandedTo( ::pPtr, pOtherSize ) METHOD height() INLINE Qt_QSizeF_height( ::pPtr ) METHOD isEmpty() INLINE Qt_QSizeF_isEmpty( ::pPtr ) METHOD isNull() INLINE Qt_QSizeF_isNull( ::pPtr ) @@ -81,11 +83,9 @@ CREATE CLASS QSizeF /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QSizeF +METHOD New( ... ) CLASS QSizeF - ::pParent := pParent - - ::pPtr := Qt_QSizeF( pParent ) + ::pPtr := Qt_QSizeF( ... ) RETURN Self diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 3a80a0d658..182ea86193 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -1615,6 +1615,115 @@ #define QIcon_On 0 // Display the pixmap when the widget is in an "on" state #define QIcon_Off 1 // Display the pixmap when the widget is in an "off" state +#define QFont_MixedCase 0 // This is the normal text rendering option where no capitalization change is applied. +#define QFont_AllUppercase 1 // This alters the text to be rendered in all uppercase type. +#define QFont_AllLowercase 2 // This alters the text to be rendered in all lowercase type. +#define QFont_SmallCaps 3 // This alters the text to be rendered in small-caps type. +#define QFont_Capitalize 4 // This alters the text to be rendered with the first character of each word as an uppercase character. + +// enum #define QFont_SpacingType +// +#define QFont_PercentageSpacing 0 // A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by the width of the character itself. +#define QFont_AbsoluteSpacing 1 // A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing. + +// enum #define QFont_Stretch +// Predefined stretch values that follow the CSS naming convention. The higher the value, the more stretched the text is. +// +#define QFont_UltraCondensed 50 +#define QFont_ExtraCondensed 62 +#define QFont_Condensed 75 +#define QFont_SemiCondensed 87 +#define QFont_Unstretched 100 +#define QFont_SemiExpanded 112 +#define QFont_Expanded 125 +#define QFont_ExtraExpanded 150 +#define QFont_UltraExpanded 200 + +// enum #define QFont_Style +// This enum describes the different styles of glyphs that are used to display text. +// +#define QFont_StyleNormal 0 // Normal glyphs used in unstyled text. +#define QFont_StyleItalic 1 // Italic glyphs that are specifically designed for the purpose of representing italicized text. +#define QFont_StyleOblique 2 // Glyphs with an italic appearance that are typically based on the unstyled glyphs, but are not fine-tuned for the purpose of representing italicized text. + +// enum #define QFont_StyleHint +// Style hints are used by the font matching algorithm to find an appropriate default family if a selected font family is not available. +// +#define QFont_AnyStyle ? // leaves the font matching algorithm to choose the family. This is the default. +#define QFont_SansSerif QFont_Helvetica // the font matcher prefer sans serif fonts. +#define QFont_Helvetica 0 // is a synonym for SansSerif. +#define QFont_Serif QFont_Times // the font matcher prefers serif fonts. +#define QFont_Times ? // is a synonym for Serif. +#define QFont_TypeWriter QFont_Courier // the font matcher prefers fixed pitch fonts. +#define QFont_Courier ? // a synonym for TypeWriter. +#define QFont_OldEnglish ? // the font matcher prefers decorative fonts. +#define QFont_Decorative QFont_OldEnglish // is a synonym for OldEnglish. +#define QFont_System ? // the font matcher prefers system fonts. + +// enum #define QFont_StyleStrategy +// The style strategy tells the font matching algorithm what type of fonts should be used to find an appropriate default family. +// +#define QFont_PreferDefault 0x0001 // the default style strategy. It does not prefer any type of font. +#define QFont_PreferBitmap 0x0002 // prefers bitmap fonts (as opposed to outline fonts). +#define QFont_PreferDevice 0x0004 // prefers device fonts. +#define QFont_PreferOutline 0x0008 // prefers outline fonts (as opposed to bitmap fonts). +#define QFont_ForceOutline 0x0010 // forces the use of outline fonts. +#define QFont_NoAntialias 0x0100 // don't antialias the fonts. +#define QFont_PreferAntialias 0x0080 // antialias if possible. +#define QFont_OpenGLCompatible 0x0200 // forces the use of OpenGL compatible fonts. +#define QFont_NoFontMerging 0x8000 // If a font does not contain a character requested to draw then Qt automatically chooses a similar looking for that contains the character. This flag disables this feature. + +// Any of these may be OR-ed with one of these flags: +// +#define QFont_PreferMatch 0x0020 // prefer an exact match. The font matcher will try to use the exact font size that has been specified. +#define QFont_PreferQuality 0x0040 // prefer the best quality font. The font matcher will use the nearest standard point size that the font supports. + +#define QFont_Light 25 +#define QFont_Normal 50 +#define QFont_DemiBold 63 +#define QFont_Bold 75 +#define QFont_Black 87 + + +#define QFileDialog_AcceptOpen 0 +#define QFileDialog_AcceptSave 1 + +// enum #define QFileDialog_DialogLabel +// +#define QFileDialog_LookIn 0 +#define QFileDialog_FileName 1 +#define QFileDialog_FileType 2 +#define QFileDialog_Accept 3 +#define QFileDialog_Reject 4 + +// enum #define QFileDialog_FileMode +// This enum is used to indicate what the user may select in the file dialog; +// i.e. what the dialog will return if the user clicks OK. +// +#define QFileDialog_AnyFile 0 // The name of a file, whether it exists or not. +#define QFileDialog_ExistingFile 1 // The name of a single existing file. +#define QFileDialog_Directory 2 // The name of a directory. Both files and directories are displayed. +#define QFileDialog_ExistingFiles 3 // The names of zero or more existing files. + +// The Options type is a typedef for QFlags