diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bf3c0a91c3..10ea7d186e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-04 13:57 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbpcombobox.prg + * contrib/hbxbp/xbpcrt.prg + * contrib/hbxbp/xbpdialog.prg + * contrib/hbxbp/xbpfiledialog.prg + * contrib/hbxbp/xbpmenubar.prg + * contrib/hbxbp/xbppushbutton.prg + * contrib/hbxbp/xbptoolbar.prg + * contrib/hbxbp/xbptreeview.prg + * contrib/hbxbp/xbpwindow.prg + ! Changed: QIcon() specific calls respecting latest changes in hbQT. + 2012-06-04 13:34 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbmk2_qt.hb ! Guarded: qth_is_QObject() function under __HBQT_REVAMP__. diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 983e21e760..a0bdf70818 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -365,7 +365,7 @@ PROTECTED: DATA oDbfModel DATA oModelIndex INIT QModelIndex() DATA oVHeaderView - DATA oHeaderView INIT QHeaderView() + DATA oHeaderView DATA oVScrollBar INIT QScrollBar() DATA oHScrollBar INIT QScrollBar() DATA oViewport INIT QWidget() @@ -1062,7 +1062,8 @@ METHOD XbpBrowse:manageMouseWheel( oWheelEvent ) /*----------------------------------------------------------------------*/ METHOD XbpBrowse:manageMousePress( oMouseEvent ) - + HB_TRACE( HB_TR_DEBUG, __objGetClsName( oMouseEvent ), valtype( oMouseEvent:pos() ), ProcName( 1 ), procName( 2 ), ProcName( 3 ) ) + ::oModelIndex := ::oTableView:indexAt( oMouseEvent:pos() ) IF ::oModelIndex:isValid() /* Reposition the record pointer */ SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, ( ::oModelIndex:row() + 1 ) - ::rowPos, Self ) @@ -1842,6 +1843,8 @@ METHOD XbpBrowse:doConfigure() nwVal := oFontMetrics:width( xVal, -1 ) nwHead := oFontMetrics:width( ::columns[ i ]:heading(), -1 ) + + ::columns[ i ]:nColWidth := max( nwVal, nwHead ) + 8 ::oHeaderView:resizeSection( i-1, max( nwVal, nwHead ) + 8 ) ::oFooterView:resizeSection( i-1, max( nwVal, nwHead ) + 8 ) diff --git a/harbour/contrib/hbxbp/xbpcombobox.prg b/harbour/contrib/hbxbp/xbpcombobox.prg index 07e5e42e5e..dcf0cd480f 100644 --- a/harbour/contrib/hbxbp/xbpcombobox.prg +++ b/harbour/contrib/hbxbp/xbpcombobox.prg @@ -91,7 +91,7 @@ CLASS XbpComboBox INHERIT XbpWindow METHOD sleSize() VIRTUAL // -> aOldSize METHOD addItem( cItem ) INLINE ::oWidget:addItem( cItem ) - METHOD setIcon( nItem,cIcon ) INLINE ::oWidget:setItemIcon( nItem-1,cIcon ) + METHOD setIcon( nItem,cIcon ) INLINE ::oWidget:setItemIcon( nItem-1, QIcon( cIcon ) ) #if 0 METHOD clear() INLINE ::oStrList:clear(),; diff --git a/harbour/contrib/hbxbp/xbpcrt.prg b/harbour/contrib/hbxbp/xbpcrt.prg index 9ab97cf47e..4034b01289 100644 --- a/harbour/contrib/hbxbp/xbpcrt.prg +++ b/harbour/contrib/hbxbp/xbpcrt.prg @@ -307,7 +307,7 @@ METHOD XbpCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget:setTooltip( ::toolTipText ) ENDIF IF hb_isChar( ::icon ) - ::oWidget:setWindowIcon( ::icon ) + ::oWidget:setWindowIcon( QIcon( ::icon ) ) ENDIF IF ::lModal diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index 679dbeb8ac..667551402a 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -210,7 +210,7 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget:setWindowTitle( ::title ) ENDIF IF hb_isChar( ::icon ) - ::oWidget:setWindowIcon( ::icon ) + ::oWidget:setWindowIcon( QIcon( ::icon ) ) ENDIF ::setPosAndSize() @@ -274,9 +274,9 @@ METHOD XbpDialog:destroy() ::oWidget:disconnect( QEvent_WindowActivate ) ::oWidget:disconnect( QEvent_WindowDeactivate ) - IF !empty( ::oEventLoop ) - hbxbp_SetEventLoop( NIL ) + IF ! empty( ::oEventLoop ) ::oEventLoop:exit( 0 ) + hbxbp_SetEventLoop( NIL ) ::oEventLoop := NIL ENDIF ::oMenu := NIL @@ -288,7 +288,7 @@ METHOD XbpDialog:destroy() ::oMdi := NIL ENDIF - RETURN Self + RETURN NIL /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index 75a058bd29..d38d41f674 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -133,7 +133,7 @@ METHOD XbpFileDialog:create( oParent, oOwner, aPos ) METHOD XbpFileDialog:_destroy() HB_TRACE( HB_TR_DEBUG, "XbpFileDialog:_destroy()" ) - //__hbqt_destroy( ::oWidget ) + __hbqt_destroy( ::oWidget ) RETURN ::destroy() /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index d8315ef246..7d036ed812 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -276,7 +276,7 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos ) ENDIF oAction:setText( cCaption ) IF hb_FileExists( cIcon ) - oAction:setIcon( cIcon ) + oAction:setIcon( QIcon( cIcon ) ) ENDIF IF !empty( cKey ) oKey := QKeySequence( cKey ) diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index 4b0dfc14aa..bd7e8a1694 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -227,7 +227,7 @@ METHOD XbpPushButton:setCaption( xCaption, cDll ) ::caption := xCaption IF hb_FileExists( xCaption ) - ::oWidget:setIcon( xCaption ) + ::oWidget:setIcon( QIcon( xCaption ) ) ELSE ::oWidget:setText( xCaption ) ENDIF diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index 8e20b94f95..63543f5511 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -258,7 +258,7 @@ METHOD XbpToolbar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS oBtn:oAction:setText( cCaption ) IF valtype( xImage ) == "C" - oBtn:oAction:setIcon( xImage ) + oBtn:oAction:setIcon( QIcon( xImage ) ) ENDIF ENDIF diff --git a/harbour/contrib/hbxbp/xbptreeview.prg b/harbour/contrib/hbxbp/xbptreeview.prg index d50a3d1595..ab76725372 100644 --- a/harbour/contrib/hbxbp/xbptreeview.prg +++ b/harbour/contrib/hbxbp/xbptreeview.prg @@ -164,7 +164,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) IF ::visible ::show() ENDIF - ::oParent:AddChild( SELF ) + ::oParent:AddChild( Self ) ::postCreate() RETURN Self @@ -172,7 +172,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /*----------------------------------------------------------------------*/ METHOD XbpTreeView:execSlot( cSlot, p ) - LOCAL n, qPt, qItem, oItem, qPos + LOCAL n, qPt, qItem, oItem IF ( n := ascan( ::aItems, {|o| iif( empty( o ), .f., hbqt_IsEqual( o:oWidget, p ) ) } ) ) > 0 oItem := ::aItems[ n ] @@ -191,10 +191,9 @@ METHOD XbpTreeView:execSlot( cSlot, p ) ::oWidget:setToolTip( iif( empty( oItem:tooltipText ), oItem:caption, oItem:tooltipText ) ) CASE cSlot == "customContextMenuRequested(QPoint)" IF HB_ISBLOCK( ::hb_contextMenu ) - qPos := QPoint( p ) - IF ( qItem := ::oWidget:itemAt( qPos ) ):hasValidPointer() + IF ! empty( qItem := ::oWidget:itemAt( p ) ) IF ( n := ascan( ::aItems, {|o| hbqt_IsEqual( o:oWidget, qItem ) } ) ) > 0 - qPt := ::oWidget:mapToGlobal( QPoint( p ) ) + qPt := ::oWidget:mapToGlobal( p ) eval( ::hb_contextMenu, { qPt:x(), qPt:y() }, NIL, ::aItems[ n ] ) ENDIF ENDIF @@ -472,7 +471,7 @@ METHOD XbpTreeViewItem:setExpandedImage( nResIdoBitmap ) METHOD XbpTreeViewItem:setImage( xIcon ) - ::oWidget:setIcon( 0, xIcon ) + ::oWidget:setIcon( 0, iif( hb_isChar( xIcon ), QIcon( xIcon ), xIcon ) ) RETURN self diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 1e8b3b6935..0425846de8 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -506,7 +506,7 @@ METHOD XbpWindow:destroy() ENDIF ::oWidget := NIL - + HB_TRACE( HB_TR_DEBUG, "DESTROYED", __objGetClsName( Self ) ) RETURN NIL /*----------------------------------------------------------------------*/ @@ -565,6 +565,8 @@ METHOD XbpWindow:clearSlots() METHOD XbpWindow:grabEvent( nEvent, oEvent ) LOCAL nXbpKey, oP0, oP1, oObj_O, oObj_N + HB_TRACE( HB_TR_DEBUG, nEvent, valtype( oEvent ), __objGetClsName( oEvent ) ) + SWITCH ( nEvent ) CASE QEvent_MouseMove // :motion()