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.
This commit is contained in:
Pritpal Bedi
2010-04-18 01:49:09 +00:00
parent 4d3b8e9a8d
commit 2df579f485
12 changed files with 201 additions and 41 deletions

View File

@@ -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

View File

@@ -297,6 +297,7 @@ STATIC FUNCTION PullOutFuncBody( protos_, nFrom )
IF s:__enumIndex() > nFrom
IF left( s, 1 ) == "}"
nTo := s:__enumIndex()
EXIT
ENDIF
ENDIF
NEXT

View File

@@ -71,11 +71,12 @@
*/
/*
* Constructed[ 48/49 [ 97.96% ] ]
* Constructed[ 48/50 [ 96.00% ] ]
*
* *** Unconvered Prototypes ***
* -----------------------------
*
* }
* QList<QDockWidget *> 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" ));
}
}
}

View File

@@ -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 <QtCore/QPointer>
#include <QtGui/QMenu>
@@ -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 );
}
}
/*

View File

@@ -65,6 +65,16 @@
#if QT_VERSION >= 0x040500
/*----------------------------------------------------------------------*/
/*
* Constructed[ 28/30 [ 93.33% ] ]
*
* *** Unconvered Prototypes ***
* -----------------------------
*
* }
* }
*/
#include <QtCore/QPointer>
#include <QtGui/QToolBar>
@@ -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" ) );
}
}
}

View File

@@ -71,11 +71,12 @@
*/
/*
* Constructed[ 52/55 [ 94.55% ] ]
* Constructed[ 52/56 [ 92.86% ] ]
*
* *** Unconvered Prototypes ***
* -----------------------------
*
* }
* void addChildren ( const QList<QTreeWidgetItem *> & children )
* void insertChildren ( int index, const QList<QTreeWidgetItem *> & children )
* QList<QTreeWidgetItem *> 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 );
}
}

View File

@@ -72,12 +72,13 @@
*/
/*
* Constructed[ 205/229 [ 89.52% ] ]
* Constructed[ 205/230 [ 89.13% ] ]
*
* *** Unconvered Prototypes ***
* -----------------------------
*
* QList<QAction *> actions () const
* }
* void addActions ( QList<QAction *> actions )
* void insertActions ( QAction * before, QList<QAction *> 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 );
}
}

View File

@@ -96,7 +96,26 @@ flags DockOptions
<PROTOS>
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 )

View File

@@ -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 )

View File

@@ -80,11 +80,38 @@ HB_FUNC( QT_QTOOLBAR )
<PROTOS>
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

View File

@@ -94,7 +94,18 @@ enum ItemType { Type, UserType }
</ENUMS>
<PROTOS>
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<QTreeWidgetItem *> & children )
QBrush background ( int column ) const
Qt::CheckState checkState ( int column ) const

View File

@@ -88,7 +88,18 @@ bool acceptDrops () const
// QString accessibleName () const
QList<QAction *> 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<QAction *> actions )
void adjustSize ()
bool autoFillBackground () const