From 2df579f4857baa3c09d0b6103337a6baa86b4e21 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sun, 18 Apr 2010 01:49:09 +0000 Subject: [PATCH] 2010-04-17 18:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/qtgui/QMainWindow.cpp * contrib/hbqt/qtgui/QMenu.cpp * contrib/hbqt/qtgui/QToolBar.cpp * contrib/hbqt/qtgui/QTreeWidgetItem.cpp * contrib/hbqt/qtgui/QWidget.cpp * contrib/hbqt/qth/QMainWindow.qth * contrib/hbqt/qth/QMenu.qth * contrib/hbqt/qth/QToolBar.qth * contrib/hbqt/qth/QTreeWidgetItem.qth * contrib/hbqt/qth/QWidget.qth * contrib/hbqt/generator/hbqtgen.prg + Applied patches provided by Francesco Perillo. Now no GPF even if oObj:destroy() is not issued. I confirm on WinXP and awaiting responses from all of you on other platforms. If all goes OK, then credit goes to Francesco and Istvan. Guys, back them up. --- harbour/ChangeLog | 22 ++++++++++ harbour/contrib/hbqt/generator/hbqtgen.prg | 1 + harbour/contrib/hbqt/qtgui/QMainWindow.cpp | 24 ++++++++--- harbour/contrib/hbqt/qtgui/QMenu.cpp | 31 ++++++++++---- harbour/contrib/hbqt/qtgui/QToolBar.cpp | 41 ++++++++++++++----- .../contrib/hbqt/qtgui/QTreeWidgetItem.cpp | 16 +++++--- harbour/contrib/hbqt/qtgui/QWidget.cpp | 16 +++++--- harbour/contrib/hbqt/qth/QMainWindow.qth | 21 +++++++++- harbour/contrib/hbqt/qth/QMenu.qth | 13 +++++- harbour/contrib/hbqt/qth/QToolBar.qth | 31 +++++++++++++- harbour/contrib/hbqt/qth/QTreeWidgetItem.qth | 13 +++++- harbour/contrib/hbqt/qth/QWidget.qth | 13 +++++- 12 files changed, 201 insertions(+), 41 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 93cc7483b3..f254a97db0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,28 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-17 18:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/qtgui/QMainWindow.cpp + * contrib/hbqt/qtgui/QMenu.cpp + * contrib/hbqt/qtgui/QToolBar.cpp + * contrib/hbqt/qtgui/QTreeWidgetItem.cpp + * contrib/hbqt/qtgui/QWidget.cpp + + * contrib/hbqt/qth/QMainWindow.qth + * contrib/hbqt/qth/QMenu.qth + * contrib/hbqt/qth/QToolBar.qth + * contrib/hbqt/qth/QTreeWidgetItem.qth + * contrib/hbqt/qth/QWidget.qth + + * contrib/hbqt/generator/hbqtgen.prg + + Applied patches provided by Francesco Perillo. + Now no GPF even if oObj:destroy() is not issued. + I confirm on WinXP and awaiting responses from all of you + on other platforms. + + If all goes OK, then credit goes to Francesco and Istvan. + Guys, back them up. + 2010-04-17 17:41 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/qtgui/QLayout.cpp * contrib/hbqt/qtgui/QTabWidget.cpp diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 813c5a0f58..2d5c24474a 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -297,6 +297,7 @@ STATIC FUNCTION PullOutFuncBody( protos_, nFrom ) IF s:__enumIndex() > nFrom IF left( s, 1 ) == "}" nTo := s:__enumIndex() + EXIT ENDIF ENDIF NEXT diff --git a/harbour/contrib/hbqt/qtgui/QMainWindow.cpp b/harbour/contrib/hbqt/qtgui/QMainWindow.cpp index 719a217838..0dfbe38303 100644 --- a/harbour/contrib/hbqt/qtgui/QMainWindow.cpp +++ b/harbour/contrib/hbqt/qtgui/QMainWindow.cpp @@ -71,11 +71,12 @@ */ /* - * Constructed[ 48/49 [ 97.96% ] ] + * Constructed[ 48/50 [ 96.00% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * + * } * QList tabifiedDockWidgets ( QDockWidget * dockwidget ) const */ @@ -209,12 +210,23 @@ HB_FUNC( QT_QMAINWINDOW_ADDDOCKWIDGET_1 ) */ HB_FUNC( QT_QMAINWINDOW_ADDTOOLBAR ) { - QMainWindow * p = hbqt_par_QMainWindow( 1 ); - if( p ) - ( p )->addToolBar( ( Qt::ToolBarArea ) hb_parni( 2 ), hbqt_par_QToolBar( 3 ) ); - else + QGC_POINTER_QMainWindow * q = ( QGC_POINTER_QMainWindow * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 3 ); + + HB_TRACE( HB_TR_DEBUG, ("QMAINWINDOW_ADDTOOLBAR" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p to: %p", (void *) p, (void *) q) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p to: %p", (void *) p->ph, (void *) q->ph) ); + + if ( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QMAINWINDOW_ADDTOOLBAR FP=( p )->addToolBar( ( Qt::ToolBarArea ) hb_parni( 2 ), hbqt_par_QToolBar( 3 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p is attached to: %p", (void *) p->ph, (void *) q->ph) ); + p->bNew = HB_FALSE; + if ( q && q->ph ) + ( q->ph )->addToolBar( ( Qt::ToolBarArea ) hb_parni( 2 ), ( ( QToolBar *) p->ph )); + else + { + HB_TRACE( HB_TR_DEBUG, ( "F=QT_QTOOLBAR_ADDACTION FP=( p )->addAction( hbqt_par_QAction( 2 ) ); p is NULL" )); + } } } diff --git a/harbour/contrib/hbqt/qtgui/QMenu.cpp b/harbour/contrib/hbqt/qtgui/QMenu.cpp index 19bd09779e..abc90affa1 100644 --- a/harbour/contrib/hbqt/qtgui/QMenu.cpp +++ b/harbour/contrib/hbqt/qtgui/QMenu.cpp @@ -65,6 +65,20 @@ #if QT_VERSION >= 0x040500 /*----------------------------------------------------------------------*/ +/* + * Constructed[ 33/36 [ 91.67% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * + * *** Commented out protos which construct fine but do not compile *** + * + * // OSMenuRef macMenu ( OSMenuRef merge = 0 ) + * // HMENU wceMenu ( bool create = false ) + */ + #include #include @@ -258,13 +272,16 @@ HB_FUNC( QT_QMENU_ADDACTION_3 ) */ HB_FUNC( QT_QMENU_ADDACTION_4 ) { - QMenu * p = hbqt_par_QMenu( 1 ); - if( p ) - ( p )->addAction( hbqt_par_QAction( 2 ) ); - else - { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QMENU_ADDACTION_4 FP=( p )->addAction( hbqt_par_QAction( 2 ) ); p is NULL" ) ); - } + QGC_POINTER_QMenu * q = ( QGC_POINTER_QMenu * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QMENU_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QMENU_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addAction( ( QAction * ) p->ph ); + } } /* diff --git a/harbour/contrib/hbqt/qtgui/QToolBar.cpp b/harbour/contrib/hbqt/qtgui/QToolBar.cpp index 16a497eae4..c60802b210 100644 --- a/harbour/contrib/hbqt/qtgui/QToolBar.cpp +++ b/harbour/contrib/hbqt/qtgui/QToolBar.cpp @@ -65,6 +65,16 @@ #if QT_VERSION >= 0x040500 /*----------------------------------------------------------------------*/ +/* + * Constructed[ 28/30 [ 93.33% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + */ + #include #include @@ -184,12 +194,15 @@ HB_FUNC( QT_QTOOLBAR_ACTIONAT_1 ) */ HB_FUNC( QT_QTOOLBAR_ADDACTION ) { - QToolBar * p = hbqt_par_QToolBar( 1 ); - if( p ) - ( p )->addAction( hbqt_par_QAction( 2 ) ); - else + QGC_POINTER_QToolBar * q = ( QGC_POINTER_QToolBar * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTOOLBAR_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QTOOLBAR_ADDACTION FP=( p )->addAction( hbqt_par_QAction( 2 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addAction( ( QAction * ) p->ph ); } } @@ -240,12 +253,20 @@ HB_FUNC( QT_QTOOLBAR_ADDACTION_3 ) */ HB_FUNC( QT_QTOOLBAR_ADDACTION_4 ) { - QToolBar * p = hbqt_par_QToolBar( 1 ); - if( p ) - hb_retptrGC( hbqt_gcAllocate_QAction( ( p )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), hbqt_par_QObject( 4 ), hbqt_par_char( 5 ) ), false ) ); - else + QGC_POINTER_QToolBar * q = ( QGC_POINTER_QToolBar * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 4 ); + + HB_TRACE( HB_TR_DEBUG, ("QTOOLBAR_ADDACTION_4" ) ); + if ( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QTOOLBAR_ADDACTION_4 FP=hb_retptrGC( hbqt_gcAllocate_QAction( ( p )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), hbqt_par_QObject( 4 ), hbqt_par_char( 5 ) ), false ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDITEM_4: %p is attached to: %p", (void *) p->ph, (void *) q->ph ) ) ; + p->bNew = HB_FALSE; + if ( q && q->ph ) + hb_retptrGC( hbqt_gcAllocate_QAction( ( q->ph )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), (QObject *) ( p->ph), hbqt_par_char( 5 ) ), false ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "F=QT_QTOOLBAR_ADDACTION_4 FP=hb_retptrGC( hbqt_gcAllocate_QAction( ( p )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), hbqt_par_QObject( 4 ), hbqt_par_char( 5 ) ), false ) ); p is NULL" ) ); + } } } diff --git a/harbour/contrib/hbqt/qtgui/QTreeWidgetItem.cpp b/harbour/contrib/hbqt/qtgui/QTreeWidgetItem.cpp index 1a6e4224a3..9e78103320 100644 --- a/harbour/contrib/hbqt/qtgui/QTreeWidgetItem.cpp +++ b/harbour/contrib/hbqt/qtgui/QTreeWidgetItem.cpp @@ -71,11 +71,12 @@ */ /* - * Constructed[ 52/55 [ 94.55% ] ] + * Constructed[ 52/56 [ 92.86% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * + * } * void addChildren ( const QList & children ) * void insertChildren ( int index, const QList & children ) * QList takeChildren () @@ -172,12 +173,15 @@ HB_FUNC( QT_QTREEWIDGETITEM ) */ HB_FUNC( QT_QTREEWIDGETITEM_ADDCHILD ) { - QTreeWidgetItem * p = hbqt_par_QTreeWidgetItem( 1 ); - if( p ) - ( p )->addChild( hbqt_par_QTreeWidgetItem( 2 ) ); - else + QGC_POINTER_QTreeWidgetItem * q = ( QGC_POINTER_QTreeWidgetItem * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTREEWIDGETITEM_ADDCHILD()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QTREEWIDGETITEM_ADDCHILD FP=( p )->addChild( hbqt_par_QTreeWidgetItem( 2 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addChild( ( QTreeWidgetItem * ) p->ph ); } } diff --git a/harbour/contrib/hbqt/qtgui/QWidget.cpp b/harbour/contrib/hbqt/qtgui/QWidget.cpp index eec0fac973..73e003a30e 100644 --- a/harbour/contrib/hbqt/qtgui/QWidget.cpp +++ b/harbour/contrib/hbqt/qtgui/QWidget.cpp @@ -72,12 +72,13 @@ */ /* - * Constructed[ 205/229 [ 89.52% ] ] + * Constructed[ 205/230 [ 89.13% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * * QList actions () const + * } * void addActions ( QList actions ) * void insertActions ( QAction * before, QList actions ) * @@ -224,12 +225,15 @@ HB_FUNC( QT_QWIDGET_ACTIVATEWINDOW ) */ HB_FUNC( QT_QWIDGET_ADDACTION ) { - QWidget * p = hbqt_par_QWidget( 1 ); - if( p ) - ( p )->addAction( hbqt_par_QAction( 2 ) ); - else + QGC_POINTER_QWidget * q = (QGC_POINTER_QWidget *)hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = (QGC_POINTER *)hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QWIDGET_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QWIDGET_ADDACTION FP=( p )->addAction( hbqt_par_QAction( 2 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QWIDGET_ADDACTION() Qt object: %p is attached to: %p", (void * )p->ph, (void *)q->ph ) ); + // p->bNew = HB_FALSE; // The ownership of action is not transferred to this QWidget. + ( q->ph )->addAction( ( QAction * ) p->ph ); } } diff --git a/harbour/contrib/hbqt/qth/QMainWindow.qth b/harbour/contrib/hbqt/qth/QMainWindow.qth index c3961b5bf4..cf04845de4 100644 --- a/harbour/contrib/hbqt/qth/QMainWindow.qth +++ b/harbour/contrib/hbqt/qth/QMainWindow.qth @@ -96,7 +96,26 @@ flags DockOptions void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget ) void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget, Qt::Orientation orientation ) -void addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ) +void addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ){ + QGC_POINTER_QMainWindow * q = ( QGC_POINTER_QMainWindow * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 3 ); + + HB_TRACE( HB_TR_DEBUG, ("QMAINWINDOW_ADDTOOLBAR" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p to: %p", (void *) p, (void *) q) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p to: %p", (void *) p->ph, (void *) q->ph) ); + + if ( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QMAINWINDOW_ADDTOOLBAR() Qt object: %p is attached to: %p", (void *) p->ph, (void *) q->ph) ); + p->bNew = HB_FALSE; + if ( q && q->ph ) + ( q->ph )->addToolBar( ( Qt::ToolBarArea ) hb_parni( 2 ), ( ( QToolBar *) p->ph )); + else + { + HB_TRACE( HB_TR_DEBUG, ( "F=QT_QTOOLBAR_ADDACTION FP=( p )->addAction( hbqt_par_QAction( 2 ) ); p is NULL" )); + } + } +} void addToolBar ( QToolBar * toolbar ) QToolBar * addToolBar ( const QString & title ) void addToolBarBreak ( Qt::ToolBarArea area = Qt::TopToolBarArea ) diff --git a/harbour/contrib/hbqt/qth/QMenu.qth b/harbour/contrib/hbqt/qth/QMenu.qth index be35541d1e..1e251fecc7 100644 --- a/harbour/contrib/hbqt/qth/QMenu.qth +++ b/harbour/contrib/hbqt/qth/QMenu.qth @@ -89,7 +89,18 @@ QAction * addAction ( const QString & text ) QAction * addAction ( const QIcon & icon, const QString & text ) QAction * addAction ( const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0 ) QAction * addAction ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0 ) -void addAction ( QAction * action ) +void addAction ( QAction * action ){ + QGC_POINTER_QMenu * q = ( QGC_POINTER_QMenu * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QMENU_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QMENU_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addAction( ( QAction * ) p->ph ); + } +} QAction * addMenu ( QMenu * menu ) QMenu * addMenu ( const QString & title ) QMenu * addMenu ( const QIcon & icon, const QString & title ) diff --git a/harbour/contrib/hbqt/qth/QToolBar.qth b/harbour/contrib/hbqt/qth/QToolBar.qth index fbc4bb4fff..8f98b1f4f0 100644 --- a/harbour/contrib/hbqt/qth/QToolBar.qth +++ b/harbour/contrib/hbqt/qth/QToolBar.qth @@ -80,11 +80,38 @@ HB_FUNC( QT_QTOOLBAR ) QAction * actionAt ( const QPoint & p ) const QAction * actionAt ( int x, int y ) const -void addAction ( QAction * action ) +void addAction ( QAction * action ){ + QGC_POINTER_QToolBar * q = ( QGC_POINTER_QToolBar * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTOOLBAR_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addAction( ( QAction * ) p->ph ); + } +} QAction * addAction ( const QString & text ) QAction * addAction ( const QIcon & icon, const QString & text ) QAction * addAction ( const QString & text, const QObject * receiver, const char * member ) -QAction * addAction ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member ) +QAction * addAction ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member ){ + QGC_POINTER_QToolBar * q = ( QGC_POINTER_QToolBar * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 4 ); + + HB_TRACE( HB_TR_DEBUG, ("QTOOLBAR_ADDACTION_4" ) ); + if ( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDITEM_4: %p is attached to: %p", (void *) p->ph, (void *) q->ph ) ) ; + p->bNew = HB_FALSE; + if ( q && q->ph ) + hb_retptrGC( hbqt_gcAllocate_QAction( ( q->ph )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), (QObject *) ( p->ph), hbqt_par_char( 5 ) ), false ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "F=QT_QTOOLBAR_ADDACTION_4 FP=hb_retptrGC( hbqt_gcAllocate_QAction( ( p )->addAction( QIcon( hbqt_par_QString( 2 ) ), QToolBar::tr( hb_parc( 3 ) ), hbqt_par_QObject( 4 ), hbqt_par_char( 5 ) ), false ) ); p is NULL" ) ); + } + } +} QAction * addSeparator () QAction * addWidget ( QWidget * widget ) Qt::ToolBarAreas allowedAreas () const diff --git a/harbour/contrib/hbqt/qth/QTreeWidgetItem.qth b/harbour/contrib/hbqt/qth/QTreeWidgetItem.qth index c01765ad4a..f7aada1759 100644 --- a/harbour/contrib/hbqt/qth/QTreeWidgetItem.qth +++ b/harbour/contrib/hbqt/qth/QTreeWidgetItem.qth @@ -94,7 +94,18 @@ enum ItemType { Type, UserType } -void addChild ( QTreeWidgetItem * child ) +void addChild ( QTreeWidgetItem * child ){ + QGC_POINTER_QTreeWidgetItem * q = ( QGC_POINTER_QTreeWidgetItem * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QTREEWIDGETITEM_ADDCHILD()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QTOOLBAR_ADDACTION() Qt oject: %p is attached to: %p", ( void * ) p->ph, ( void * ) q->ph ) ); + p->bNew = HB_FALSE; + ( q->ph )->addChild( ( QTreeWidgetItem * ) p->ph ); + } +} void addChildren ( const QList & children ) QBrush background ( int column ) const Qt::CheckState checkState ( int column ) const diff --git a/harbour/contrib/hbqt/qth/QWidget.qth b/harbour/contrib/hbqt/qth/QWidget.qth index da17fce7fb..60748e6a58 100644 --- a/harbour/contrib/hbqt/qth/QWidget.qth +++ b/harbour/contrib/hbqt/qth/QWidget.qth @@ -88,7 +88,18 @@ bool acceptDrops () const // QString accessibleName () const QList actions () const void activateWindow () -void addAction ( QAction * action ) +void addAction ( QAction * action ){ + QGC_POINTER_QWidget * q = (QGC_POINTER_QWidget *)hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * p = (QGC_POINTER *)hb_parptrGC( hbqt_gcFuncs(), 2 ); + + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QWIDGET_ADDACTION()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QWIDGET_ADDACTION() Qt object: %p is attached to: %p", (void * )p->ph, (void *)q->ph ) ); + // p->bNew = HB_FALSE; // The ownership of action is not transferred to this QWidget. + ( q->ph )->addAction( ( QAction * ) p->ph ); + } +} void addActions ( QList actions ) void adjustSize () bool autoFillBackground () const