2010-09-17 15:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtgui/g/QComboBox.cpp
    * Re-generated.

  * contrib/hbqt/qtgui/qth/QComboBox.qth
    ! Detached one child from GC cycle - :setView()

  * contrib/hbxbp/xbpcombobox.prg
    ! Fixed to support inheritance.

    Thanks Shum for real-time Xbase++ code example.
    Now it can be compiled with Harbour + hbQT without any line change.
This commit is contained in:
Pritpal Bedi
2010-09-17 22:32:50 +00:00
parent 059f098199
commit b3934d258a
4 changed files with 56 additions and 15 deletions

View File

@@ -16,6 +16,19 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-09-17 15:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/g/QComboBox.cpp
* Re-generated.
* contrib/hbqt/qtgui/qth/QComboBox.qth
! Detached one child from GC cycle - :setView()
* contrib/hbxbp/xbpcombobox.prg
! Fixed to support inheritance.
Thanks Shum for real-time Xbase++ code example.
Now it can be compiled with Harbour + hbQT without any line change.
2010-09-17 08:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/qth/QIcon.qth
! An important change in constructor.

View File

@@ -71,6 +71,15 @@
* enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, AdjustToMinimumContentsLength, AdjustToMinimumContentsLengthWithIcon }
*/
/*
* Constructed[ 59/60 [ 98.33% ] ]
*
* *** Unconvered Prototypes ***
* -----------------------------
*
* }
*/
#include <QtCore/QPointer>
#include <QtGui/QComboBox>
@@ -772,10 +781,12 @@ HB_FUNC( QT_QCOMBOBOX_SETVALIDATOR )
*/
HB_FUNC( QT_QCOMBOBOX_SETVIEW )
{
QComboBox * p = hbqt_par_QComboBox( 1 );
if( p )
HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 );
if( p && p->ph && q && q->ph )
{
( p )->setView( hbqt_par_QAbstractItemView( 2 ) );
q->bNew = HB_FALSE;
hbqt_par_QComboBox( 1 )->setView( hbqt_par_QAbstractItemView( 2 ) );
}
}

View File

@@ -133,7 +133,15 @@ void setModelColumn ( int visibleColumn )
void setRootModelIndex ( const QModelIndex & index )
void setSizeAdjustPolicy ( SizeAdjustPolicy policy )
void setValidator ( const QValidator * validator )
void setView ( QAbstractItemView * itemView )
void setView ( QAbstractItemView * itemView ){
HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
HBQT_GC_T * q = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 2 );
if( p && p->ph && q && q->ph )
{
q->bNew = HB_FALSE;
hbqt_par_QComboBox( 1 )->setView( hbqt_par_QAbstractItemView( 2 ) );
}
}
virtual void showPopup ()
SizeAdjustPolicy sizeAdjustPolicy () const
virtual const QValidator * validator () const

View File

@@ -78,6 +78,7 @@ CLASS XbpComboBox INHERIT XbpWindow
DATA type INIT XBPCOMBO_DROPDOWN
DATA drawMode INIT XBP_DRAW_NORMAL
// MESSAGE init( ... ) METHOD new( ... )
METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject )
@@ -134,14 +135,17 @@ METHOD XbpComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oSLE := XbpSLE():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oLB := XbpListBox():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oSLE := XbpSLE():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::visible )
::oLB := XbpListBox():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::visible )
::oWidget := QComboBox( ::pParent )
::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr )
::oWidget:setEditable( ::XbpSLE:editable )
::oWidget:setFrame( ::XbpSLE:border )
::oWidget:setModel( QAbstractItemModel():from( ::xbpListBox:model() ) )
::oWidget:setView( ::xbpListBox:oWidget )
::oWidget:setLineEdit( ::xbpSLE:oWidget )
//::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr )
::oWidget:setEditable( ::xbpSLE:editable )
::oWidget:setFrame( ::xbpSLE:border )
::oWidget:connect( "highlighted(int)" , {|i| ::execSlot( "highlighted(int)" , i ) } )
::oWidget:connect( "activated(int)" , {|i| ::execSlot( "activated(int)" , i ) } )
@@ -166,18 +170,20 @@ METHOD XbpComboBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
::oWidget:pPtr := pQtObject
ELSE
::oSLE := XbpSLE():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oLB := XbpListBox():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oSLE := XbpSLE():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::lVisible )
::oLB := XbpListBox():new():create( ::oParent, ::oOwner, ::aPos, ::aSize, ::aPresParams, ::lVisible )
::oWidget := QComboBox( ::pParent )
::oWidget:setModel( QAbstractItemModel():from( ::xbpListBox:model() ) )
::oWidget:setView( ::xbpListBox:oWidget )
::oWidget:setLineEdit( ::xbpSLE:oWidget )
::oWidget:setEditable( ::xbpSLE:editable )
::oWidget:setFrame( ::xbpSLE:border )
::setPosAndSize()
IF ::visible
::show()
ENDIF
::oWidget:setLineEdit( ::XbpSLE:oWidget )
::oWidget:setEditable( ::XbpSLE:editable )
::oWidget:setFrame( ::XbpSLE:border )
ENDIF
::oWidget:connect( "highlighted(int)" , {|i| ::execSlot( "highlighted(int)" , i ) } )
@@ -191,6 +197,9 @@ METHOD XbpComboBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams,
METHOD XbpComboBox:destroy()
::xbpSLE:destroy()
::xbpListBox:destroy()
::xbpWindow:destroy()
RETURN NIL