From 4a01f6b28ce295979cb69f52fede98b8356300e8 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 7 Jul 2009 08:17:21 +0000 Subject: [PATCH] 2009-07-07 01:13 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/generator/hbqtgen.prg * harbour/contrib/hbqt/qth/QBrush.qth * harbour/contrib/hbqt/qth/QColor.qth * harbour/contrib/hbqt/qth/QCursor.qth * harbour/contrib/hbqt/qth/QIcon.qth * harbour/contrib/hbqt/qth/QPalette.qth * harbour/contrib/hbqt/qth/QPen.qth * harbour/contrib/hbqt/qth/QSize.qth * harbour/contrib/hbqt/hbqt.h * harbour/contrib/hbqt/QBrush.cpp * harbour/contrib/hbqt/QColor.cpp * harbour/contrib/hbqt/QCursor.cpp * harbour/contrib/hbqt/QIcon.cpp * harbour/contrib/hbqt/QPalette.cpp * harbour/contrib/hbqt/QPen.cpp * harbour/contrib/hbqt/QSize.cpp * harbour/contrib/hbqt/TQBrush.prg * harbour/contrib/hbqt/TQColor.prg * harbour/contrib/hbqt/TQCursor.prg * harbour/contrib/hbqt/TQIcon.prg * harbour/contrib/hbqt/TQPalette.prg * harbour/contrib/hbqt/TQPen.prg * harbour/contrib/hbqt/TQSize.prg ! More qualifying classes with :new( ... ) syntax. --- harbour/ChangeLog | 30 +++++++++ harbour/contrib/hbqt/QBrush.cpp | 58 +++++++++++++++- harbour/contrib/hbqt/QColor.cpp | 22 +++++-- harbour/contrib/hbqt/QCursor.cpp | 41 +++++++++++- harbour/contrib/hbqt/QIcon.cpp | 4 ++ harbour/contrib/hbqt/QPalette.cpp | 23 +++---- harbour/contrib/hbqt/QPen.cpp | 31 ++++++++- harbour/contrib/hbqt/QSize.cpp | 27 +++++++- harbour/contrib/hbqt/TQBrush.prg | 42 +++++++++++- harbour/contrib/hbqt/TQColor.prg | 42 +++++++++++- harbour/contrib/hbqt/TQCursor.prg | 42 +++++++++++- harbour/contrib/hbqt/TQIcon.prg | 42 +++++++++++- harbour/contrib/hbqt/TQPalette.prg | 42 +++++++++++- harbour/contrib/hbqt/TQPen.prg | 42 +++++++++++- harbour/contrib/hbqt/TQSize.prg | 44 ++++++++++++- harbour/contrib/hbqt/generator/hbqtgen.prg | 23 +++---- harbour/contrib/hbqt/hbqt.h | 2 +- harbour/contrib/hbqt/qth/QBrush.qth | 77 +++++++++++++++++++++- harbour/contrib/hbqt/qth/QColor.qth | 34 +++++++--- harbour/contrib/hbqt/qth/QCursor.qth | 55 +++++++++++++++- harbour/contrib/hbqt/qth/QIcon.qth | 12 +++- harbour/contrib/hbqt/qth/QPalette.qth | 32 ++++----- harbour/contrib/hbqt/qth/QPen.qth | 47 ++++++++++++- harbour/contrib/hbqt/qth/QSize.qth | 22 +++++-- 24 files changed, 736 insertions(+), 100 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7709b02de3..61134318c3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,36 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-07 01:13 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/hbqtgen.prg + + * harbour/contrib/hbqt/qth/QBrush.qth + * harbour/contrib/hbqt/qth/QColor.qth + * harbour/contrib/hbqt/qth/QCursor.qth + * harbour/contrib/hbqt/qth/QIcon.qth + * harbour/contrib/hbqt/qth/QPalette.qth + * harbour/contrib/hbqt/qth/QPen.qth + * harbour/contrib/hbqt/qth/QSize.qth + + * harbour/contrib/hbqt/hbqt.h + + * harbour/contrib/hbqt/QBrush.cpp + * harbour/contrib/hbqt/QColor.cpp + * harbour/contrib/hbqt/QCursor.cpp + * harbour/contrib/hbqt/QIcon.cpp + * harbour/contrib/hbqt/QPalette.cpp + * harbour/contrib/hbqt/QPen.cpp + * harbour/contrib/hbqt/QSize.cpp + + * harbour/contrib/hbqt/TQBrush.prg + * harbour/contrib/hbqt/TQColor.prg + * harbour/contrib/hbqt/TQCursor.prg + * harbour/contrib/hbqt/TQIcon.prg + * harbour/contrib/hbqt/TQPalette.prg + * harbour/contrib/hbqt/TQPen.prg + * harbour/contrib/hbqt/TQSize.prg + ! More qualifying classes with :new( ... ) syntax. + 2009-07-07 07:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/generator/hbqtgen.prg * Formatting. diff --git a/harbour/contrib/hbqt/QBrush.cpp b/harbour/contrib/hbqt/QBrush.cpp index 5d8c4607ba..1e97d23465 100644 --- a/harbour/contrib/hbqt/QBrush.cpp +++ b/harbour/contrib/hbqt/QBrush.cpp @@ -78,7 +78,63 @@ */ HB_FUNC( QT_QBRUSH ) { - hb_retptr( ( QBrush* ) new 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 + } + else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) ); + } + else + { + hb_retptr( ( QBrush* ) new QBrush() ); + } } /* diff --git a/harbour/contrib/hbqt/QColor.cpp b/harbour/contrib/hbqt/QColor.cpp index 936d88cc64..1aa1eded31 100644 --- a/harbour/contrib/hbqt/QColor.cpp +++ b/harbour/contrib/hbqt/QColor.cpp @@ -66,30 +66,38 @@ QColor () QColor ( int r, int g, int b, int a = 255 ) QColor ( QRgb color ) +QColor ( Qt::GlobalColor color ) QColor ( const QString & name ) QColor ( const char * name ) QColor ( const QColor & color ) -QColor ( Qt::GlobalColor color ) */ HB_FUNC( QT_QCOLOR ) { - if( hb_pcount() == 1 ) + if( hb_pcount() >= 1 ) { - if( HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 ) + if( hb_pcount() == 1 && HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 ) { hb_retptr( ( QColor* ) new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); } - else if( HB_ISNUM( 1 ) ) + else if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { hb_retptr( ( QColor* ) new QColor( ( QRgb ) hb_parni( 1 ) ) ); } - else if( HB_ISPOINTER( 1 ) ) + else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) ) + { + hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { hb_retptr( ( QColor* ) new QColor( *hbqt_par_QColor( 1 ) ) ); } - else if( HB_ISCHAR( 1 ) ) + else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) ) { - hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) ); + hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) ); + } + else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) ) + { + hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) ); } else { diff --git a/harbour/contrib/hbqt/QCursor.cpp b/harbour/contrib/hbqt/QCursor.cpp index 08de69f190..b5937cc23e 100644 --- a/harbour/contrib/hbqt/QCursor.cpp +++ b/harbour/contrib/hbqt/QCursor.cpp @@ -76,7 +76,46 @@ */ HB_FUNC( QT_QCURSOR ) { - hb_retptr( ( QCursor* ) new QCursor() ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + hb_retptr( ( QCursor* ) new QCursor( ( Qt::CursorShape ) hb_parni( 1 ) ) ); + } + 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(); + + 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 ) ) ); + } + else + { + hb_retptr( ( QCursor* ) new QCursor() ); + } + #endif + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QBitmap( 1 ), *hbqt_par_QBitmap( 2 ), + 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/QIcon.cpp b/harbour/contrib/hbqt/QIcon.cpp index 5ae7a6db62..f80236a55a 100644 --- a/harbour/contrib/hbqt/QIcon.cpp +++ b/harbour/contrib/hbqt/QIcon.cpp @@ -87,6 +87,10 @@ HB_FUNC( QT_QICON ) { hb_retptr( ( QIcon* ) new QIcon( hbqt_par_QString( 1 ) ) ); } + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QIcon* ) new QIcon( *hbqt_par_QPixmap( 1 ) ) ); + } else { hb_retptr( ( QIcon* ) new QIcon() ); diff --git a/harbour/contrib/hbqt/QPalette.cpp b/harbour/contrib/hbqt/QPalette.cpp index 24d37c86a7..34c7560022 100644 --- a/harbour/contrib/hbqt/QPalette.cpp +++ b/harbour/contrib/hbqt/QPalette.cpp @@ -74,24 +74,17 @@ */ HB_FUNC( QT_QPALETTE ) { - if( hb_pcount() >= 2 ) + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - hb_retptr( ( QPalette* ) new QPalette() ); + hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); } - else if( hb_pcount() == 1 ) + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { - if( HB_ISPOINTER( 1 ) ) - { - hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ) ) ); - } - else if( HB_ISNUM( 1 ) ) - { - hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) ); - } - else - { - hb_retptr( ( QPalette* ) new QPalette() ); - } + hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QPalette( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ), *hbqt_par_QColor( 2 ) ) ); } else { diff --git a/harbour/contrib/hbqt/QPen.cpp b/harbour/contrib/hbqt/QPen.cpp index ed44744834..5677d8cdb0 100644 --- a/harbour/contrib/hbqt/QPen.cpp +++ b/harbour/contrib/hbqt/QPen.cpp @@ -85,7 +85,36 @@ HB_FUNC( QT_QPEN ) { if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) { - hb_retptr( ( QPen* ) new QPen() ); + hb_retptr( ( QPen* ) new QPen( ( Qt::PenStyle ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( ( QPen* ) new QPen( *hbqt_par_QColor( 1 ) ) ); + + #if 0 /* TODO */ + QString objName = hbqt_par_QObject( 1 )->objectName(); + + if( objName == ( QString ) "QColor" ) + { + hb_retptr( ( QPen* ) new QPen( *hbqt_par_QColor( 1 ) ) ); + } + else if( objName == ( QString ) "QPen" ) + { + hb_retptr( ( QPen* ) new QPen( *hbqt_par_QPen( 1 ) ) ); + } + else + { + hb_retptr( ( QPen* ) new QPen() ); + } + #endif + } + else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QPen* ) new QPen( *hbqt_par_QBrush( 1 ), hb_parnd( 2 ), + HB_ISNUM( 3 ) ? ( Qt::PenStyle ) hb_parni( 3 ) : Qt::SolidLine, + HB_ISNUM( 4 ) ? ( Qt::PenCapStyle ) hb_parni( 4 ) : Qt::SquareCap, + HB_ISNUM( 5 ) ? ( Qt::PenJoinStyle ) hb_parni( 5 ) : Qt::BevelJoin + ) ); } else { diff --git a/harbour/contrib/hbqt/QSize.cpp b/harbour/contrib/hbqt/QSize.cpp index 7dba331f54..85f8ee4365 100644 --- a/harbour/contrib/hbqt/QSize.cpp +++ b/harbour/contrib/hbqt/QSize.cpp @@ -66,12 +66,17 @@ /* * QSize () * QSize ( int width, int height ) - * QSize boundedTo ( const QSize & otherSize ) const - * QSize expandedTo ( const QSize & otherSize ) const */ HB_FUNC( QT_QSIZE ) { - hb_retptr( ( QSize* ) new QSize( hb_parni( 1 ), hb_parni( 2 ) ) ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + hb_retptr( ( QSize* ) new QSize( hb_parni( 1 ), hb_parni( 2 ) ) ); + } + else + { + hb_retptr( ( QSize* ) new QSize() ); + } } /* @@ -170,6 +175,22 @@ HB_FUNC( QT_QSIZE_WIDTH ) hb_retni( hbqt_par_QSize( 1 )->width() ); } +/* + * QSize boundedTo ( const QSize & otherSize ) const + */ +HB_FUNC( QT_QSIZE_BOUNDEDTO ) +{ + hb_retptr( new QSize( hbqt_par_QSize( 1 )->boundedTo( *hbqt_par_QSize( 2 ) ) ) ); +} + +/* + * QSize expandedTo ( const QSize & otherSize ) const + */ +HB_FUNC( QT_QSIZE_EXPANDEDTO ) +{ + hb_retptr( new QSize( hbqt_par_QSize( 1 )->expandedTo( *hbqt_par_QSize( 2 ) ) ) ); +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/TQBrush.prg b/harbour/contrib/hbqt/TQBrush.prg index 5e3da2d6f3..ec6ba9aafe 100644 --- a/harbour/contrib/hbqt/TQBrush.prg +++ b/harbour/contrib/hbqt/TQBrush.prg @@ -82,11 +82,47 @@ CREATE CLASS QBrush /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QBrush +METHOD New( ... ) CLASS QBrush + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QBrush( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QBrush() + + CASE nParams == 1 + ::pPtr := Qt_QBrush( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QBrush( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQColor.prg b/harbour/contrib/hbqt/TQColor.prg index 3b9cde19ad..78d912f253 100644 --- a/harbour/contrib/hbqt/TQColor.prg +++ b/harbour/contrib/hbqt/TQColor.prg @@ -133,11 +133,47 @@ CREATE CLASS QColor /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QColor +METHOD New( ... ) CLASS QColor + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QColor( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QColor() + + CASE nParams == 1 + ::pPtr := Qt_QColor( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QColor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQCursor.prg b/harbour/contrib/hbqt/TQCursor.prg index c8d0db9091..0bdeb2fcb4 100644 --- a/harbour/contrib/hbqt/TQCursor.prg +++ b/harbour/contrib/hbqt/TQCursor.prg @@ -77,11 +77,47 @@ CREATE CLASS QCursor /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QCursor +METHOD New( ... ) CLASS QCursor + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QCursor( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QCursor() + + CASE nParams == 1 + ::pPtr := Qt_QCursor( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QCursor( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQIcon.prg b/harbour/contrib/hbqt/TQIcon.prg index 9b151bc57a..f958c96db3 100644 --- a/harbour/contrib/hbqt/TQIcon.prg +++ b/harbour/contrib/hbqt/TQIcon.prg @@ -78,11 +78,47 @@ CREATE CLASS QIcon /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QIcon +METHOD New( ... ) CLASS QIcon + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QIcon( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QIcon() + + CASE nParams == 1 + ::pPtr := Qt_QIcon( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QIcon( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQPalette.prg b/harbour/contrib/hbqt/TQPalette.prg index 2e5d97221e..f2503eb561 100644 --- a/harbour/contrib/hbqt/TQPalette.prg +++ b/harbour/contrib/hbqt/TQPalette.prg @@ -103,11 +103,47 @@ CREATE CLASS QPalette /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPalette +METHOD New( ... ) CLASS QPalette + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QPalette( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QPalette() + + CASE nParams == 1 + ::pPtr := Qt_QPalette( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QPalette( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQPen.prg b/harbour/contrib/hbqt/TQPen.prg index 33cdf7c31c..576d773b6a 100644 --- a/harbour/contrib/hbqt/TQPen.prg +++ b/harbour/contrib/hbqt/TQPen.prg @@ -89,11 +89,47 @@ CREATE CLASS QPen /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QPen +METHOD New( ... ) CLASS QPen + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QPen( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QPen() + + CASE nParams == 1 + ::pPtr := Qt_QPen( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QPen( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/TQSize.prg b/harbour/contrib/hbqt/TQSize.prg index 79865438bf..e60dd94224 100644 --- a/harbour/contrib/hbqt/TQSize.prg +++ b/harbour/contrib/hbqt/TQSize.prg @@ -75,16 +75,54 @@ CREATE CLASS QSize METHOD setWidth( nWidth ) INLINE Qt_QSize_setWidth( ::pPtr, nWidth ) METHOD transpose() INLINE Qt_QSize_transpose( ::pPtr ) METHOD width() INLINE Qt_QSize_width( ::pPtr ) + METHOD boundedTo( pOtherSize ) INLINE Qt_QSize_boundedTo( ::pPtr, pOtherSize ) + METHOD expandedTo( pOtherSize ) INLINE Qt_QSize_expandedTo( ::pPtr, pOtherSize ) ENDCLASS /*----------------------------------------------------------------------*/ -METHOD New( pParent ) CLASS QSize +METHOD New( ... ) CLASS QSize + LOCAL aP, nParams - ::pParent := pParent + aP := hb_aParams() + nParams := len( aP ) - ::pPtr := Qt_QSize( pParent ) + DO CASE + CASE nParams == 0 + ::pPtr := Qt_QSize() + + CASE nParams == 1 + ::pPtr := Qt_QSize( aP[ 1 ] ) + + CASE nParams == 2 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ] ) + + CASE nParams == 3 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ] ) + + CASE nParams == 4 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] ) + + CASE nParams == 5 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ] ) + + CASE nParams == 6 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ] ) + + CASE nParams == 7 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ] ) + + CASE nParams == 8 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ] ) + + CASE nParams == 9 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ] ) + + CASE nParams ==10 + ::pPtr := Qt_QSize( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[ 5 ], aP[ 6 ], aP[ 7 ], aP[ 8 ], aP[ 9 ], aP[10 ] ) + + ENDCASE RETURN Self diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index fc800df20f..1e55b4aef0 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -1484,13 +1484,11 @@ FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ ) aColumns := { { 1,'Function', 'C', 100 },; { 2,'Returns' , 'C', 20 } } - //cTitle := 'harbour/contrib/hbqt/' + cWidget - aHTML := {} nCols := len( aColumns ) aadd( aHtml, "" ) - Build_HtmlHeader( @aHTML, .F. ) + Build_HtmlHeader( @aHTML ) s := '' aadd( aHtml, s ) @@ -1499,12 +1497,12 @@ FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ ) aadd( aHtml, '' ) /* Class Documentation */ - s := "" + "CLASS METHODS" + "" + s := "" + "CLASS REFERENCE" + "" aadd( aHtml, s ) s := "" + "Source: /harbour/contrib/hbqt/T" + cWidget + ".prg" + "" aadd( aHtml, s ) s := QT_WEB + QT_VER + "/" + lower( cWidget ) + ".htm" - s := "' + s + "" + s := "' + s + "" aadd( aHtml, s ) // IF !empty( docum_ ) @@ -1515,7 +1513,9 @@ FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ ) s += '' s += '
'
       s += CRLF
-
+      s += CRLF
+      s += "IMPORTANT:  Call the constructor with exact number of parameter. "+ CRLF
+      s += "            No defaults, otherwise application will GPF" + CRLF
       for i := 1 to len( docum_ )
          s += docum_[ i ] + CRLF
       next
@@ -1541,9 +1541,9 @@ FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ )
    NEXT
 
    /* Function Documentation */
-   s := ""+ "FUNCTIONS" +""
+   s := "" + "FUNCTIONS REFERENCE" + ""
    aadd( aHtml, s )
-   s := ""+ "Source: /harbour/contrib/hbqt/hbqt_"+ lower( cWidget ) +".cpp" +""
+   s := "" + "Source: /harbour/contrib/hbqt/" + cWidget + ".cpp" + ""
    aadd( aHtml, s )
    FOR j := 1 TO len( aHF_ )
       s := ""
@@ -1598,9 +1598,7 @@ FUNCTION Build_HtmlTable( aHTML, cTitle, SetColorTable )
 
 /*----------------------------------------------------------------------*/
 
-FUNCTION Build_HtmlHeader( aHTML, lPreDisplayNone )
-
-   DEFAULT lPreDisplayNone TO .T.
+FUNCTION Build_HtmlHeader( aHTML )
 
    aadd( aHtml, '                                                             ' )
    aadd( aHtml, '  ' )
@@ -1628,9 +1626,6 @@ FUNCTION Build_HtmlHeader( aHTML, lPreDisplayNone )
    aadd( aHtml, '    }                                                              ' )
    aadd( aHtml, '    pre                                                            ' )
    aadd( aHtml, '    {                                                              ' )
-if lPreDisplayNone
-   aadd( aHtml, '      display          : none;                                     ' )
-endif
    aadd( aHtml, '      font-family      : Courier New;                              ' )
    aadd( aHtml, '      font-size        : .7em;                                     ' )
    aadd( aHtml, '      color            : black;                                    ' )
diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h
index 3336e8e85c..6d8f3d7be7 100644
--- a/harbour/contrib/hbqt/hbqt.h
+++ b/harbour/contrib/hbqt/hbqt.h
@@ -234,7 +234,7 @@
 #define hbqt_par_QEventLoop( n )             ( ( QEventLoop* ) hb_parptr( n ) )
 #define hbqt_par_QPaintEvent( n )            ( ( QPaintEvent* ) hb_parptr( n ) )
 #define hbqt_par_QInputEvent( n )            ( ( QInputEvent* ) hb_parptr( n ) )
-#define hbqt_par_QIcon( n )                  ( ( QIcon* ) hb_parcx( n ) )
+#define hbqt_par_QIcon( n )                  ( ( QIcon* ) hb_parptr( n ) )
 #define hbqt_par_QStyleOption( n )           ( ( QStyleOption* ) hb_parptr( n ) )
 #define hbqt_par_QStyleOptionComplex( n )    ( ( QStyleOptionComplex* ) hb_parptr( n ) )
 #define hbqt_par_QFontMetrics( n )           ( ( QFontMetrics* ) hb_parptr( n ) )
diff --git a/harbour/contrib/hbqt/qth/QBrush.qth b/harbour/contrib/hbqt/qth/QBrush.qth
index 9bcb25610c..3848022c0d 100644
--- a/harbour/contrib/hbqt/qth/QBrush.qth
+++ b/harbour/contrib/hbqt/qth/QBrush.qth
@@ -56,10 +56,27 @@
 
 
 Inherits = 
-Type     = Core
+Type     = PlainObject
 New      = 
 
 
+
+oBrush := QBrush():new()
+oBrush := QBrush():new( pQPixmap )
+oBrush := QBrush():new( nQt_GlobalColor )
+oBrush := QBrush():new( nQt_GlobalColor, nQt_BrushStyle )  // i.e. Qt_SolidPattern 
+oBrush := QBrush():new( pQColor, nQt_BrushStyle )          // i.e. Qt_SolidPattern 
+oBrush := QBrush():new( pQColor, pQPixmap )
+oBrush := QBrush():new( nQt_GlobalColor, pQPixmap )
+
+/* TODO
+ * oBrush := QBrush():new( pQImage )
+ * oBrush := QBrush():new( pQBrush )
+ * oBrush := QBrush():new( pQGradient )
+ * oBrush := QBrush():new( pQColor )
+ */
+
+
 
 #include 
 
@@ -79,7 +96,63 @@ New      =
  */
 HB_FUNC( QT_QBRUSH )
 {
-   hb_retptr( ( QBrush* ) new 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
+   }
+   else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+   {
+      hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), Qt::SolidPattern ) );
+   }
+   else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
+   {
+      hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) );
+   }
+   else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) )
+   {
+      hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), ( Qt::BrushStyle ) hb_parni( 2 ) ) );
+   }
+   else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) )
+   {
+      hb_retptr( ( QBrush* ) new QBrush( *hbqt_par_QColor( 1 ), *hbqt_par_QPixmap( 2 ) ) );
+   }
+   else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) )
+   {
+      hb_retptr( ( QBrush* ) new QBrush( ( Qt::GlobalColor ) hb_parni( 1 ), *hbqt_par_QPixmap( 2 ) ) );
+   }
+   else
+   {
+      hb_retptr( ( QBrush* ) new QBrush() );
+   }
 }
 
 
diff --git a/harbour/contrib/hbqt/qth/QColor.qth b/harbour/contrib/hbqt/qth/QColor.qth
index d940cf4c63..31d1cec0c4 100644
--- a/harbour/contrib/hbqt/qth/QColor.qth
+++ b/harbour/contrib/hbqt/qth/QColor.qth
@@ -56,10 +56,20 @@
 
 
 Inherits = 
-Type     = Core
+Type     = PlainObject 
 New      = 
 
 
+
+oColor := QColor():new()                       // You will supply other parameter later
+oColor := QColor():new( nQt_Color )            // R: hbqt.ch
+oColor := QColor():new( nRGB )                 // ( nR + ( nG * 256 ) + ( nB * 256 * 256 ) )
+oColor := QColor():new( cColorName )           // #RRGGBB
+oColor := QColor():new( pQColor )              // Pointer to previously obtained QColor
+oColor := QColor():new( nR, nG, nB )           // Red Green Blue values
+oColor := QColor():new( nR, nG, nB, nAlpha )   // Red Green Blue values with Alpha Channel
+
+
 
 #include 
 
@@ -67,30 +77,38 @@ New      =
 QColor ()
 QColor ( int r, int g, int b, int a = 255 )
 QColor ( QRgb color )
+QColor ( Qt::GlobalColor color )
 QColor ( const QString & name )
 QColor ( const char * name )
 QColor ( const QColor & color )
-QColor ( Qt::GlobalColor color )
  */
 HB_FUNC( QT_QCOLOR )
 {
-   if( hb_pcount() == 1 )
+   if( hb_pcount() >= 1 )
    {
-      if( HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 )
+      if( hb_pcount() == 1 && HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 )
       {
          hb_retptr( ( QColor* ) new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
       }
-      else if( HB_ISNUM( 1 ) )
+      else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
       {
          hb_retptr( ( QColor* ) new QColor( ( QRgb ) hb_parni( 1 ) ) );
       } 
-      else if( HB_ISPOINTER( 1 ) )
+      else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
+      {
+         hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) );
+      }
+      else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
       {
          hb_retptr( ( QColor* ) new QColor( *hbqt_par_QColor( 1 ) ) );
       }
-      else if( HB_ISCHAR( 1 ) )
+      else if( hb_pcount() == 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) )
       {
-         hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) );
+         hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), ( int ) 255 ) );
+      }
+      else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) )
+      {
+         hb_retptr( ( QColor* ) new QColor( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ) ) );
       }
       else
       {
diff --git a/harbour/contrib/hbqt/qth/QCursor.qth b/harbour/contrib/hbqt/qth/QCursor.qth
index 303f0ae49f..d006a50d94 100644
--- a/harbour/contrib/hbqt/qth/QCursor.qth
+++ b/harbour/contrib/hbqt/qth/QCursor.qth
@@ -56,10 +56,22 @@
 
 
 Inherits =
-Type     = Core
+Type     = PlainObject
 New      =
 
 
+
+oCursor := QCursor():new()
+oCursor := QCursor():new( nQt_CursorShape )
+oCursor := QCursor():new( pQPixmap )
+oCursor := QCursor():new( pQBitmap, pQBitmapAsMask, [ nHotX = -1 ], [ nHotY = -1 ] )
+oCursor := QCursor():new( pQPixmap, nHotX, [ nHotY = -1 ] )
+
+/* TODO
+ * oCursor := QCursor():new( pQCursor )
+ */
+
+
 
 #include 
 #include 
@@ -77,7 +89,46 @@ New      =
  */
 HB_FUNC( QT_QCURSOR )
 {
-   hb_retptr( ( QCursor* ) new QCursor() );
+   if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
+   {
+      hb_retptr( ( QCursor* ) new QCursor( ( Qt::CursorShape ) hb_parni( 1 ) ) );
+   }
+   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();
+
+      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 ) ) );
+      }
+      else
+      {
+         hb_retptr( ( QCursor* ) new QCursor() );
+      }
+      #endif 
+   }
+   else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) )
+   {
+      hb_retptr( ( QCursor* ) new QCursor( *hbqt_par_QBitmap( 1 ), *hbqt_par_QBitmap( 2 ), 
+                                           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/qth/QIcon.qth b/harbour/contrib/hbqt/qth/QIcon.qth
index cb098be4a7..066b15afd0 100644
--- a/harbour/contrib/hbqt/qth/QIcon.qth
+++ b/harbour/contrib/hbqt/qth/QIcon.qth
@@ -55,10 +55,16 @@
 ;
 
 
-Type     = Core
+Type     = PlainObject
 New      = 
 
 
+
+oIcon := QIcon():new()
+oIcon := QIcon():new( cFileName )
+oIcon := QIcon():new( pQPixmap )
+
+
 
 #include 
 
@@ -78,6 +84,10 @@ HB_FUNC( QT_QICON )
    {
       hb_retptr( ( QIcon* ) new QIcon( hbqt_par_QString( 1 ) ) );
    }
+   if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
+   {
+      hb_retptr( ( QIcon* ) new QIcon( *hbqt_par_QPixmap( 1 ) ) );
+   }
    else
    {
       hb_retptr( ( QIcon* ) new QIcon() );
diff --git a/harbour/contrib/hbqt/qth/QPalette.qth b/harbour/contrib/hbqt/qth/QPalette.qth
index 5abb83b035..9384316852 100644
--- a/harbour/contrib/hbqt/qth/QPalette.qth
+++ b/harbour/contrib/hbqt/qth/QPalette.qth
@@ -56,10 +56,17 @@
 
 
 Inherits = 
-Type     = Core
+Type     = PlainObject
 New      = 
 
 
+
+oPalette := QPalette():new()
+oPalette := QPalette():new( nQt_color )
+oPalette := QPalette():new( pQPalette )
+oPalette := QPalette():new( pQColorButton, pQColorWindow )
+
+
 
 #include 
 
@@ -75,24 +82,17 @@ New      =
  */
 HB_FUNC( QT_QPALETTE )
 {
-   if( hb_pcount() >= 2 )
+   if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
    {
-      hb_retptr( ( QPalette* ) new QPalette() );
+      hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
    }
-   else if( hb_pcount() == 1 )
+   else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
    {
-      if( HB_ISPOINTER( 1 ) )
-      {
-         hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ) ) );
-      }
-      else if( HB_ISNUM( 1 ) )
-      {
-         hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
-      }
-      else
-      {
-         hb_retptr( ( QPalette* ) new QPalette() );
-      }
+      hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QPalette( 1 ) ) );
+   }
+   else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) )
+   {
+      hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ), *hbqt_par_QColor( 2 ) ) );
    }
    else
    {
diff --git a/harbour/contrib/hbqt/qth/QPen.qth b/harbour/contrib/hbqt/qth/QPen.qth
index 55659e35cb..d681bf2372 100644
--- a/harbour/contrib/hbqt/qth/QPen.qth
+++ b/harbour/contrib/hbqt/qth/QPen.qth
@@ -55,9 +55,23 @@
 ;
 
 
-New =
+New  =
+Type = PlainObject
 
 
+
+oPen := QPen():new()
+oPen := QPen():new( nQt_PenStyle )
+oPen := QPen():new( pQColor )
+oPen := QPen():new( pQBrush, nWidth, [ nQt_PenStyle = Qt_SolidLine ], ;
+                                     [ nQt_CapStyle = Qt_SquareCap ], ;
+                                     [ nQt_PenJointStyle = Qt_BevelJoin ] )
+
+/* TODO
+ * oPen := QPen():new( pQPen )
+ */
+
+
 
 #include 
 
@@ -74,8 +88,37 @@ HB_FUNC( QT_QPEN )
 {
    if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
    {
-      hb_retptr( ( QPen* ) new QPen() );
+      hb_retptr( ( QPen* ) new QPen( ( Qt::PenStyle ) hb_parni( 1 ) ) );
    }
+   else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
+   {
+      hb_retptr( ( QPen* ) new QPen( *hbqt_par_QColor( 1 ) ) );
+
+      #if 0       /* TODO */
+      QString objName = hbqt_par_QObject( 1 )->objectName();
+
+      if( objName == ( QString ) "QColor" )
+      {
+         hb_retptr( ( QPen* ) new QPen( *hbqt_par_QColor( 1 ) ) );
+      }
+      else if( objName == ( QString ) "QPen" )
+      {
+         hb_retptr( ( QPen* ) new QPen( *hbqt_par_QPen( 1 ) ) );
+      }
+      else
+      {
+         hb_retptr( ( QPen* ) new QPen() );
+      }
+      #endif
+   }
+   else if( hb_pcount() >= 2 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) )
+   {
+      hb_retptr( ( QPen* ) new QPen( *hbqt_par_QBrush( 1 ), hb_parnd( 2 ), 
+                                     HB_ISNUM( 3 ) ? ( Qt::PenStyle ) hb_parni( 3 ) : Qt::SolidLine,
+                                     HB_ISNUM( 4 ) ? ( Qt::PenCapStyle ) hb_parni( 4 ) : Qt::SquareCap,
+                                     HB_ISNUM( 5 ) ? ( Qt::PenJoinStyle ) hb_parni( 5 ) : Qt::BevelJoin
+                                   ) );      
+   }   
    else
    {
       hb_retptr( ( QPen* ) new QPen() );
diff --git a/harbour/contrib/hbqt/qth/QSize.qth b/harbour/contrib/hbqt/qth/QSize.qth
index defb42a4c3..13b1ff135a 100644
--- a/harbour/contrib/hbqt/qth/QSize.qth
+++ b/harbour/contrib/hbqt/qth/QSize.qth
@@ -55,10 +55,15 @@
 ;
 
 
-Type     = Core
-New      = nWidth, nHeight
+Type     = PlainObject
+New      = 
 
 
+
+oSize := QSize():new()
+oSize := QSize():new( nWidth, nHeight )
+
+
 
 #include 
 
@@ -66,12 +71,17 @@ New      = nWidth, nHeight
 /*
  * QSize ()
  * QSize ( int width, int height )
- * QSize boundedTo ( const QSize & otherSize ) const
- * QSize expandedTo ( const QSize & otherSize ) const
  */
 HB_FUNC( QT_QSIZE )
 {
-   hb_retptr( ( QSize* ) new QSize( hb_parni( 1 ), hb_parni( 2 ) ) );
+   if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
+   {
+      hb_retptr( ( QSize* ) new QSize( hb_parni( 1 ), hb_parni( 2 ) ) );
+   }
+   else
+   {
+      hb_retptr( ( QSize* ) new QSize() );
+   }
 }
 
 
@@ -91,6 +101,8 @@ void setHeight ( int height )
 void setWidth ( int width )
 void transpose ()
 int width () const
+QSize boundedTo ( const QSize & otherSize ) const
+QSize expandedTo ( const QSize & otherSize ) const