From 09121a270263bcb67026355ff532c9956add6fbe Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 18 Mar 2011 22:38:13 +0000 Subject: [PATCH] 2011-03-18 15:34 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/QActionEvent.qth * contrib/hbqt/qtgui/qth/QContextMenuEvent.qth * contrib/hbqt/qtgui/qth/QDragEnterEvent.qth * contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth * contrib/hbqt/qtgui/qth/QDragMoveEvent.qth * contrib/hbqt/qtgui/qth/QDropEvent.qth * contrib/hbqt/qtgui/qth/QFocusEvent.qth * contrib/hbqt/qtgui/qth/QHelpEvent.qth * contrib/hbqt/qtgui/qth/QHideEvent.qth * contrib/hbqt/qtgui/qth/QHoverEvent.qth * contrib/hbqt/qtgui/qth/QInputEvent.qth * contrib/hbqt/qtgui/qth/QMainWindow.qth * contrib/hbqt/qtgui/qth/QPaintEvent.qth * contrib/hbqt/qtgui/qth/QResizeEvent.qth * contrib/hbqt/qtgui/qth/QShortcutEvent.qth * contrib/hbqt/qtgui/qth/QShowEvent.qth * contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth ! Made: constructors more fault tolerant. --- harbour/ChangeLog | 20 +++++++++++++++++++ .../contrib/hbqt/qtgui/qth/QActionEvent.qth | 4 ++++ .../hbqt/qtgui/qth/QContextMenuEvent.qth | 4 ++++ .../hbqt/qtgui/qth/QDragEnterEvent.qth | 4 ++++ .../hbqt/qtgui/qth/QDragLeaveEvent.qth | 9 ++++++++- .../contrib/hbqt/qtgui/qth/QDragMoveEvent.qth | 4 ++++ harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth | 4 ++++ .../contrib/hbqt/qtgui/qth/QFocusEvent.qth | 4 ++++ harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth | 4 ++++ harbour/contrib/hbqt/qtgui/qth/QHideEvent.qth | 9 ++++++++- .../contrib/hbqt/qtgui/qth/QHoverEvent.qth | 4 ++++ .../contrib/hbqt/qtgui/qth/QInputEvent.qth | 9 ++++++++- .../contrib/hbqt/qtgui/qth/QMainWindow.qth | 17 +++++++++++----- .../contrib/hbqt/qtgui/qth/QPaintEvent.qth | 4 ++++ .../contrib/hbqt/qtgui/qth/QResizeEvent.qth | 6 +++++- .../contrib/hbqt/qtgui/qth/QShortcutEvent.qth | 4 ++++ harbour/contrib/hbqt/qtgui/qth/QShowEvent.qth | 9 ++++++++- .../qtgui/qth/QWindowStateChangeEvent.qth | 17 +++++++++++++--- 18 files changed, 123 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a8913ea45b..8599df69ed 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-18 15:34 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/QActionEvent.qth + * contrib/hbqt/qtgui/qth/QContextMenuEvent.qth + * contrib/hbqt/qtgui/qth/QDragEnterEvent.qth + * contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth + * contrib/hbqt/qtgui/qth/QDragMoveEvent.qth + * contrib/hbqt/qtgui/qth/QDropEvent.qth + * contrib/hbqt/qtgui/qth/QFocusEvent.qth + * contrib/hbqt/qtgui/qth/QHelpEvent.qth + * contrib/hbqt/qtgui/qth/QHideEvent.qth + * contrib/hbqt/qtgui/qth/QHoverEvent.qth + * contrib/hbqt/qtgui/qth/QInputEvent.qth + * contrib/hbqt/qtgui/qth/QMainWindow.qth + * contrib/hbqt/qtgui/qth/QPaintEvent.qth + * contrib/hbqt/qtgui/qth/QResizeEvent.qth + * contrib/hbqt/qtgui/qth/QShortcutEvent.qth + * contrib/hbqt/qtgui/qth/QShowEvent.qth + * contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth + ! Made: constructors more fault tolerant. + 2011-03-18 13:10 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqtcore.hbx ! Miss from prev commit. diff --git a/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth index 73422c99b6..8a6e0bd0df 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QActionEvent.qth @@ -74,6 +74,10 @@ HB_FUNC( QT_QACTIONEVENT ) { __HB_RETPTRGC__( new QActionEvent( hb_parni( 1 ), hbqt_par_QAction( 2 ), ( HB_ISOBJECT( 3 ) ? hbqt_par_QAction( 3 ) : 0 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QActionEvent( *hbqt_par_QActionEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth index 421061064c..cb4d8601ba 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QContextMenuEvent.qth @@ -40,6 +40,10 @@ HB_FUNC( QT_QCONTEXTMENUEVENT ) { __HB_RETPTRGC__( new QContextMenuEvent( ( QContextMenuEvent::Reason ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ), ( Qt::KeyboardModifiers ) hb_parni( 4 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QContextMenuEvent( *hbqt_par_QContextMenuEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth index 453b82145b..b2030d5406 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDragEnterEvent.qth @@ -32,6 +32,10 @@ HB_FUNC( QT_QDRAGENTEREVENT ) { __HB_RETPTRGC__( new QDragEnterEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QDragEnterEvent( *hbqt_par_QDragEnterEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth index 2a80e6a23c..55d2abd805 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDragLeaveEvent.qth @@ -28,7 +28,14 @@ Constructor = no */ HB_FUNC( QT_QDRAGLEAVEEVENT ) { - __HB_RETPTRGC__( new QDragLeaveEvent() ); + if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QDragLeaveEvent( *hbqt_par_QDragLeaveEvent( 1 ) ) ); + } + else + { + __HB_RETPTRGC__( new QDragLeaveEvent() ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth index 3731027d13..3c02209d0e 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDragMoveEvent.qth @@ -33,6 +33,10 @@ HB_FUNC( QT_QDRAGMOVEEVENT ) { __HB_RETPTRGC__( new QDragMoveEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ), ( QEvent::Type ) ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : QEvent::DragMove ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QDragMoveEvent( *hbqt_par_QDragMoveEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth index aa1618db7c..7df2ec3403 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDropEvent.qth @@ -32,6 +32,10 @@ HB_FUNC( QT_QDROPEVENT ) { __HB_RETPTRGC__( new QDropEvent( *hbqt_par_QPoint( 1 ), ( Qt::DropActions ) hb_parni( 2 ), hbqt_par_QMimeData( 3 ), ( Qt::MouseButtons ) hb_parni( 4 ), ( Qt::KeyboardModifiers ) hb_parni( 5 ), ( QEvent::Type ) ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : QEvent::Drop ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QDropEvent( *hbqt_par_QDropEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QFocusEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QFocusEvent.qth index db93b08015..bde728bf12 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QFocusEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QFocusEvent.qth @@ -32,6 +32,10 @@ HB_FUNC( QT_QFOCUSEVENT ) { __HB_RETPTRGC__( new QFocusEvent( ( QEvent::Type ) hb_parni( 1 ), ( Qt::FocusReason ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : Qt::OtherFocusReason ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QFocusEvent( *hbqt_par_QFocusEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth index da32c395e8..86f9c94716 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QHelpEvent.qth @@ -32,6 +32,10 @@ HB_FUNC( QT_QHELPEVENT ) { __HB_RETPTRGC__( new QHelpEvent( ( QEvent::Type ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QHelpEvent( *hbqt_par_QHelpEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QHideEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QHideEvent.qth index 35a0a382d9..e7b293d8c5 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QHideEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QHideEvent.qth @@ -28,7 +28,14 @@ Constructor = no */ HB_FUNC( QT_QHIDEEVENT ) { - __HB_RETPTRGC__( new QHideEvent() ); + if( hb_pcount() == 0 ) + { + __HB_RETPTRGC__( new QHideEvent() ); + } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QHideEvent( *hbqt_par_QHideEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth index d7d056d5c6..a12622bf15 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QHoverEvent.qth @@ -74,6 +74,10 @@ HB_FUNC( QT_QHOVEREVENT ) { __HB_RETPTRGC__( new QHoverEvent( ( QEvent::Type ) hb_parni( 1 ), *hbqt_par_QPoint( 2 ), *hbqt_par_QPoint( 3 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QHoverEvent( *hbqt_par_QHoverEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QInputEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QInputEvent.qth index 78eb7a275b..4ee94fc063 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QInputEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QInputEvent.qth @@ -28,7 +28,14 @@ New = */ HB_FUNC( QT_QINPUTEVENT ) { - __HB_RETPTRGC__( new QInputEvent( ( QEvent::Type ) hb_parni( 1 ), ( Qt::KeyboardModifiers ) hb_parni( 2 ) ) ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) + { + __HB_RETPTRGC__( new QInputEvent( ( QEvent::Type ) hb_parni( 1 ), ( Qt::KeyboardModifiers ) hb_parni( 2 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QInputEvent( *hbqt_par_QInputEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QMainWindow.qth b/harbour/contrib/hbqt/qtgui/qth/QMainWindow.qth index 46134572e4..0c2e438b90 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QMainWindow.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QMainWindow.qth @@ -27,7 +27,14 @@ New = pParent, nFlags */ HB_FUNC( QT_QMAINWINDOW ) { - __HB_RETPTRGC__( new QMainWindow( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) hb_parni( 2 ) ) ); + if( hb_pcount() <= 2 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QMainWindow( hbqt_par_QWidget( 1 ), ( Qt::WindowFlags ) ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : 0 ) ) ); + } + else + { + __HB_RETPTRGC__( new QMainWindow() ); + } } HB_FUNC( HBQT_QMAINWINDOW_SAVESETTINGS ) @@ -77,14 +84,14 @@ void removeToolBarBreak ( QToolBar * before ) bool restoreDockWidget ( QDockWidget * dockwidget ) bool restoreState ( const QByteArray & state, int version = 0 ) QByteArray saveState ( int version = 0 ) const -void setCentralWidget ( QWidget * widget ) [*D=1*] +void setCentralWidget ( QWidget * widget ) void setCorner ( Qt::Corner corner, Qt::DockWidgetArea area ) void setDockOptions ( DockOptions options ) void setDocumentMode ( bool enabled ) void setIconSize ( const QSize & iconSize ) -void setMenuBar ( QMenuBar * menuBar ) [*D=1*] -void setMenuWidget ( QWidget * menuBar ) [*D=1*] -void setStatusBar ( QStatusBar * statusbar ) [*D=1*] +void setMenuBar ( QMenuBar * menuBar ) +void setMenuWidget ( QWidget * menuBar ) +void setStatusBar ( QStatusBar * statusbar ) void setTabPosition ( Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition ) void setTabShape ( QTabWidget::TabShape tabShape ) void setToolButtonStyle ( Qt::ToolButtonStyle toolButtonStyle ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth index 2bf4d2b8cc..bd9392cd33 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QPaintEvent.qth @@ -38,6 +38,10 @@ HB_FUNC( QT_QPAINTEVENT ) { __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QRect( 1 ) ) ); } + else if( hbqt_isObjectType( 1, HBQT_TYPE_QPaintEvent ) ) + { + __HB_RETPTRGC__( new QPaintEvent( *hbqt_par_QPaintEvent( 1 ) ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth index 56af47906c..5bb98c3816 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QResizeEvent.qth @@ -14,7 +14,7 @@ QObject = no Inherits = QEvent -Type = Core +Type = New = Constructor = @@ -32,6 +32,10 @@ HB_FUNC( QT_QRESIZEEVENT ) { __HB_RETPTRGC__( new QResizeEvent( *hbqt_par_QSize( 1 ), *hbqt_par_QSize( 2 ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QResizeEvent( *hbqt_par_QResizeEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth index bc17c3996a..98b107e8fc 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QShortcutEvent.qth @@ -75,6 +75,10 @@ HB_FUNC( QT_QSHORTCUTEVENT ) { __HB_RETPTRGC__( new QShortcutEvent( *hbqt_par_QKeySequence( 1 ), hb_parni( 2 ), ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : false ) ) ); } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QShortcutEvent( *hbqt_par_QShortcutEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QShowEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QShowEvent.qth index eac654e60f..02fc2652d7 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QShowEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QShowEvent.qth @@ -28,7 +28,14 @@ Constructor = */ HB_FUNC( QT_QSHOWEVENT ) { - __HB_RETPTRGC__( new QShowEvent() ); + if( hb_pcount() == 0 ) + { + __HB_RETPTRGC__( new QShowEvent() ); + } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QShowEvent( *hbqt_par_QShowEvent( 1 ) ) ); + } } diff --git a/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth b/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth index 845f35f33a..a3d049f5cf 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWindowStateChangeEvent.qth @@ -14,9 +14,9 @@ QObject = no Inherits = QEvent -Type = Core +Type = New = -Constructor = no +Constructor = @@ -28,7 +28,18 @@ Constructor = no */ HB_FUNC( QT_QWINDOWSTATECHANGEEVENT ) { - // __HB_RETPTRGC__( new QWindowStateChangeEvent() ); + if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISLOG( 2 ) ) + { + __HB_RETPTRGC__( new QWindowStateChangeEvent( ( Qt::WindowStates ) hb_parni( 1 ), hb_parl( 2 ) ) ); + } + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + __HB_RETPTRGC__( new QWindowStateChangeEvent( ( Qt::WindowStates ) hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) + { + __HB_RETPTRGC__( new QWindowStateChangeEvent( *hbqt_par_QWindowStateChangeEvent( 1 ) ) ); + } }