diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fe24c271e6..7fb999a001 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,39 @@ The license applies to all entries newer than 2009-04-28. */ +2010-09-14 15:00 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/hbpprocess.prg + * contrib/hbxbp/xbp3state.prg + * contrib/hbxbp/xbpbitmap.prg + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbpcheckbox.prg + * contrib/hbxbp/xbpclipboard.prg + * contrib/hbxbp/xbpcombobox.prg + * contrib/hbxbp/xbpdialog.prg + * contrib/hbxbp/xbpfiledialog.prg + * contrib/hbxbp/xbpfontdialog.prg + * contrib/hbxbp/xbpgeneric.prg + * contrib/hbxbp/xbphtmlviewer.prg + * contrib/hbxbp/xbplistbox.prg + * contrib/hbxbp/xbpmenubar.prg + * contrib/hbxbp/xbpmle.prg + * contrib/hbxbp/xbpprintdialog.prg + * contrib/hbxbp/xbpprinter.prg + * contrib/hbxbp/xbppushbutton.prg + * contrib/hbxbp/xbpradiobutton.prg + * contrib/hbxbp/xbprtf.prg + * contrib/hbxbp/xbpscrollbar.prg + * contrib/hbxbp/xbpsle.prg + * contrib/hbxbp/xbpspinbutton.prg + * contrib/hbxbp/xbpstatic.prg + * contrib/hbxbp/xbpstatusbar.prg + * contrib/hbxbp/xbptabpage.prg + * contrib/hbxbp/xbptoolbar.prg + * contrib/hbxbp/xbptreeview.prg + * contrib/hbxbp/xbpwindow.prg + ! Adopted to new hbQT syntax. + Q*Class():new( ... ) => Q*Class( ... ) + 2010-09-14 14:47 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/tests/demoqt.prg ! Adopted to new syntax. diff --git a/harbour/contrib/hbxbp/hbpprocess.prg b/harbour/contrib/hbxbp/hbpprocess.prg index 3f0afec655..f26e043075 100644 --- a/harbour/contrib/hbxbp/hbpprocess.prg +++ b/harbour/contrib/hbxbp/hbpprocess.prg @@ -179,7 +179,7 @@ METHOD HbpProcess:output( bBlock ) METHOD HbpProcess:addArg( cArg ) IF empty( ::qStrList ) - ::qStrList := QStringList():new() + ::qStrList := QStringList() ENDIF ::qStrList:append( cArg ) @@ -193,7 +193,7 @@ METHOD HbpProcess:start( cShellCmd ) ::cShellCmd := cShellCmd - ::qProcess := QProcess():new() + ::qProcess := QProcess() ::qProcess:setReadChannel( 1 ) #if 0 diff --git a/harbour/contrib/hbxbp/xbp3state.prg b/harbour/contrib/hbxbp/xbp3state.prg index fdb48f9c7d..3b2b23a340 100644 --- a/harbour/contrib/hbxbp/xbp3state.prg +++ b/harbour/contrib/hbxbp/xbp3state.prg @@ -107,7 +107,7 @@ METHOD Xbp3State:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QCheckBox():New( ::oParent:oWidget ) + ::oWidget := QCheckBox( ::oParent:oWidget ) ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) diff --git a/harbour/contrib/hbxbp/xbpbitmap.prg b/harbour/contrib/hbxbp/xbpbitmap.prg index 812ee90448..f5f5964eea 100644 --- a/harbour/contrib/hbxbp/xbpbitmap.prg +++ b/harbour/contrib/hbxbp/xbpbitmap.prg @@ -87,7 +87,7 @@ CLASS XbpBitmap ACCESS planes INLINE 0 ACCESS xSize INLINE ::oWidget:width() ACCESS ySize INLINE ::oWidget:height() - + METHOD new() INLINE Self METHOD create( oPS ) METHOD configure() VIRTUAL @@ -114,7 +114,7 @@ METHOD XbpBitmap:create( oPS ) DEFAULT oPS TO ::oPS ::oPS := oPS - ::oWidget := QImage():new() + ::oWidget := QImage() RETURN Self diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 27b62e44e2..caeb968774 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -544,7 +544,7 @@ METHOD new( nTop, nLeft, nBottom, nRight ) CLASS XbpBrowse ::colorSpec := SetColor() - ::oDefaultCellSize := QSize():New(20,::nCellHeight) + ::oDefaultCellSize := QSize(20,::nCellHeight) RETURN Self @@ -561,7 +561,7 @@ METHOD XbpBrowse:openPersistentEditor() METHOD XbpBrowse:buildLeftFreeze() /* Left Freeze */ - ::oLeftView := HBQTableView():new() + ::oLeftView := HBQTableView() // ::oLeftView:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ::oLeftView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) @@ -580,14 +580,14 @@ METHOD XbpBrowse:buildLeftFreeze() ::oLeftHeaderView:configure( ::oLeftView:horizontalHeader() ) ::oLeftHeaderView:setHighlightSections( .F. ) - ::oLeftDbfModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 151, t, role, x, y ) } ) + ::oLeftDbfModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 151, t, role, x, y ) } ) ::oLeftView:setModel( ::oLeftDbfModel ) // //::oLeftView:hide() /* Horizontal Footer */ - ::oLeftFooterView := QHeaderView():new( Qt_Horizontal ) + ::oLeftFooterView := QHeaderView( Qt_Horizontal ) // ::oLeftFooterView:setHighlightSections( .F. ) ::oLeftFooterView:setMinimumHeight( 20 ) @@ -595,7 +595,7 @@ METHOD XbpBrowse:buildLeftFreeze() ::oLeftFooterView:setResizeMode( QHeaderView_Fixed ) ::oLeftFooterView:setFocusPolicy( Qt_NoFocus ) // - ::oLeftFooterModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 152, t, role, x, y ) } ) + ::oLeftFooterModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 152, t, role, x, y ) } ) ::oLeftFooterView:setModel( ::oLeftFooterModel ) // @@ -613,7 +613,7 @@ METHOD XbpBrowse:buildRightFreeze() LOCAL oVHdr /* Left Freeze */ - ::oRightView := HBQTableView():new() + ::oRightView := HBQTableView() // ::oRightView:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ::oRightView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) @@ -632,12 +632,12 @@ METHOD XbpBrowse:buildRightFreeze() ::oRightHeaderView:configure( ::oRightView:horizontalHeader() ) ::oRightHeaderView:setHighlightSections( .F. ) - ::oRightDbfModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 161, t, role, x, y ) } ) + ::oRightDbfModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 161, t, role, x, y ) } ) ::oRightView:setModel( ::oRightDbfModel ) /* Horizontal Footer */ - ::oRightFooterView := QHeaderView():new( Qt_Horizontal ) + ::oRightFooterView := QHeaderView( Qt_Horizontal ) // ::oRightFooterView:setHighlightSections( .F. ) ::oRightFooterView:setMinimumHeight( 20 ) @@ -645,7 +645,7 @@ METHOD XbpBrowse:buildRightFreeze() ::oRightFooterView:setResizeMode( QHeaderView_Fixed ) ::oRightFooterView:setFocusPolicy( Qt_NoFocus ) // - ::oRightFooterModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 162, t, role, x, y ) } ) + ::oRightFooterModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 162, t, role, x, y ) } ) ::oRightFooterView:setModel( ::oRightFooterModel ) @@ -662,14 +662,14 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Plain ) /* Important here as other parts will be based on it*/ ::setPosAndSize() /* Subclass of QTableView */ - ::oTableView := HBQTableView():new() + ::oTableView := HBQTableView() /* Some parameters */ ::oTableView:setTabKeyNavigation( .t. ) @@ -691,7 +691,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* Finetune Horizontal Scrollbar */ ::oTableView:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) // - ::oHScrollBar := QScrollBar():new() + ::oHScrollBar := QScrollBar() ::oHScrollBar:setOrientation( Qt_Horizontal ) ::oHScrollBar:connect( "actionTriggered(int)" , {|i| ::execSlot( __ev_horzscroll_slidermoved__ , i ) } ) ::oHScrollBar:connect( "sliderReleased()" , {|i| ::execSlot( __ev_horzscroll_sliderreleased__, i ) } ) @@ -699,7 +699,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) /* Replace Vertical Scrollbar with our own */ ::oTableView:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) // - ::oVScrollBar := QScrollBar():new() + ::oVScrollBar := QScrollBar() ::oVScrollBar:setOrientation( Qt_Vertical ) ::oVScrollBar:connect( "actionTriggered(int)" , {|i| ::execSlot( __ev_vertscroll_via_user__ , i ) } ) ::oVScrollBar:connect( "sliderReleased()" , {|i| ::execSlot( __ev_vertscroll_sliderreleased__, i ) } ) @@ -718,13 +718,13 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oHeaderView:connect( "sectionResized(int,int,int)" , {|i,i1,i2| ::execSlot( __ev_headersec_resized__ , i, i1, i2 ) } ) /* .DBF Manipulation Model */ - ::oDbfModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 141, t, role, x, y ) } ) + ::oDbfModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 141, t, role, x, y ) } ) /* Attach Model with the View */ ::oTableView:setModel( ::oDbfModel ) /* Horizontal Footer */ - ::oFooterView := QHeaderView():new( Qt_Horizontal ) + ::oFooterView := QHeaderView( Qt_Horizontal ) // ::oFooterView:setHighlightSections( .F. ) @@ -733,7 +733,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oFooterView:setResizeMode( QHeaderView_Fixed ) ::oFooterView:setFocusPolicy( Qt_NoFocus ) // - ::oFooterModel := HBQAbstractItemModel():new( {|t,role,x,y| ::supplyInfo( 142, t, role, x, y ) } ) + ::oFooterModel := HBQAbstractItemModel( {|t,role,x,y| ::supplyInfo( 142, t, role, x, y ) } ) ::oFooterView:setModel( ::oFooterModel ) ::oFooterView:setFocusPolicy( Qt_NoFocus ) @@ -744,7 +744,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::buildRightFreeze() /* Place all widgets in a Grid Layout */ - ::oGridLayout := QGridLayout():new( ::pWidget ) + ::oGridLayout := QGridLayout( ::pWidget ) ::oGridLayout:setContentsMargins( 0,0,0,0 ) ::oGridLayout:setHorizontalSpacing( 0 ) ::oGridLayout:setVerticalSpacing( 0 ) @@ -778,7 +778,7 @@ METHOD XbpBrowse:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget:setGeometry( qRect ) /* Handle the delegate */ - ::qDelegate := QItemDelegate():new() + ::qDelegate := QItemDelegate() ::oTableView:setItemDelegate( ::qDelegate ) ::qDelegate:connect( "closeEditor(QWidget,int)", {|p,p1| ::execSlot( __editor_closeEditor__, p, p1 ) } ) @@ -856,7 +856,7 @@ METHOD XbpBrowse:execSlot( nEvent, p1, p2, p3 ) CASE nEvent == __ev_mousepress__ oMouseEvent := QMouseEvent():configure( p1 ) - oPoint := QPoint():new( oMouseEvent:x(), oMouseEvent:y() ) + oPoint := QPoint( oMouseEvent:x(), oMouseEvent:y() ) ::oModelIndex:configure( ::oTableView:indexAt( oPoint ) ) IF ::oModelIndex:isValid() /* Reposition the record pointer */ SetAppEvent( xbeBRW_Navigate, XBPBRW_Navigate_Skip, ( ::oModelIndex:row() + 1 ) - ::rowPos, Self ) @@ -1342,12 +1342,12 @@ METHOD fetchColumnInfo( nCall, nRole, nArea, nRow, nCol ) CLASS XbpBrowse // Implementation choice will depend on planned HBQt evolution of pseudo casts and bypass functions (non GC QColor, QIcon, etc) METHOD compatColor( nColor ) - RETURN QColor():new( nColor ) + RETURN QColor( nColor ) /*----------------------------------------------------------------------*/ METHOD compatIcon( cIcon ) - RETURN QIcon():new( QPixmap():new( Trim( cIcon ) ) ) + RETURN QIcon( QPixmap( Trim( cIcon ) ) ) /*----------------------------------------------------------------------*/ @@ -1728,7 +1728,7 @@ METHOD doConfigure() CLASS XbpBrowse ::oRightFooterView:setResizeMode( QHeaderView_Fixed ) /* Set column widths */ - oFontMetrics := QFontMetrics():new( "QFont", ::oTableView:font() ) + oFontMetrics := QFontMetrics( "QFont", ::oTableView:font() ) // FOR i := 1 TO len( ::columns ) IF ::columns[ i ]:nColWidth != NIL diff --git a/harbour/contrib/hbxbp/xbpcheckbox.prg b/harbour/contrib/hbxbp/xbpcheckbox.prg index dc97782047..b2ed0f20d6 100644 --- a/harbour/contrib/hbxbp/xbpcheckbox.prg +++ b/harbour/contrib/hbxbp/xbpcheckbox.prg @@ -107,7 +107,7 @@ METHOD XbpCheckBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QCheckBox():New( ::oParent:oWidget ) + ::oWidget := QCheckBox( ::oParent:oWidget ) ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) ::setPosAndSize() diff --git a/harbour/contrib/hbxbp/xbpclipboard.prg b/harbour/contrib/hbxbp/xbpclipboard.prg index b654e742e1..3de250e6d0 100644 --- a/harbour/contrib/hbxbp/xbpclipboard.prg +++ b/harbour/contrib/hbxbp/xbpclipboard.prg @@ -104,7 +104,7 @@ METHOD XbpClipBoard:new() METHOD XbpClipBoard:create() - ::oWidget := QClipBoard():new() + ::oWidget := QClipBoard() RETURN Self diff --git a/harbour/contrib/hbxbp/xbpcombobox.prg b/harbour/contrib/hbxbp/xbpcombobox.prg index f1ebffecbd..658070f43a 100644 --- a/harbour/contrib/hbxbp/xbpcombobox.prg +++ b/harbour/contrib/hbxbp/xbpcombobox.prg @@ -137,7 +137,7 @@ METHOD XbpComboBox: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():New( ::pParent ) + ::oWidget := QComboBox( ::pParent ) ::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr ) ::oWidget:setEditable( ::XbpSLE:editable ) @@ -169,7 +169,7 @@ METHOD XbpComboBox:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, ::oSLE := XbpSLE():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oLB := XbpListBox():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QComboBox():New( ::pParent ) + ::oWidget := QComboBox( ::pParent ) ::setPosAndSize() IF ::visible ::show() diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index 969b081055..b0c36991b8 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -156,7 +156,7 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF ::oWidget:setMouseTracking( .t. ) ELSE - ::oWidget := QMainWindow():new() + ::oWidget := QMainWindow() ::oWidget:setMouseTracking( .t. ) ::oWidget:setObjectName( "mainWindow" ) ENDIF @@ -208,7 +208,7 @@ METHOD XbpDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF /* Install Event Loop per Dialog Basis */ - ::oEventLoop := QEventLoop():new( ::pWidget ) + ::oEventLoop := QEventLoop( ::pWidget ) hbxbp_SetEventLoop( ::oEventLoop ) /* Instal Event Filter */ @@ -420,7 +420,7 @@ METHOD XbpDrawingArea:create( oParent, oOwner, aPos, aSize, aPresParams, lVisibl ::oWidget := QWidget() ::oWidget:pPtr := hbqt_ptr( ::qtObject ) ELSE - ::oWidget := QWidget():new()// ::oParent:oWidget ) + ::oWidget := QWidget() ENDIF ::oWidget:setMouseTracking( .T. ) diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index c79aff32c9..067ef2774e 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -110,7 +110,7 @@ METHOD XbpFileDialog:create( oParent, oOwner, aPos ) ::xbpWindow:create( oParent, oOwner, aPos ) - ::oWidget := QFileDialog():new( ::pParent ) + ::oWidget := QFileDialog( ::pParent ) //::oWidget:setStyle( AppDesktop():style() ) //::setStyle() //::setColorBG( GraMakeRGBColor( { 255,255,255 } ) ) @@ -203,7 +203,7 @@ METHOD XbpFileDialog:open( cDefaultFile, lCenter, lAllowMultiple, lCreateNewFile IF len( ::fileFilters ) == 1 ::oWidget:setNameFilter( Xbp_ArrayToFileFilter( ::fileFilters[ 1 ] ) ) ELSE - oList := QStringList():new() + oList := QStringList() FOR i := 1 TO len( ::fileFilters ) oList:append( Xbp_ArrayToFileFilter( ::fileFilters[ i ] ) ) NEXT @@ -254,7 +254,7 @@ METHOD XbpFileDialog:saveAs( cDefaultFile, lFileList, lCenter ) IF len( ::fileFilters ) == 1 ::oWidget:setNameFilter( Xbp_ArrayToFileFilter( ::fileFilters[ 1 ] ) ) ELSE - oList := QStringList():new() + oList := QStringList() FOR i := 1 TO len( ::fileFilters ) oList:append( Xbp_ArrayToFileFilter( ::fileFilters[ i ] ) ) NEXT diff --git a/harbour/contrib/hbxbp/xbpfontdialog.prg b/harbour/contrib/hbxbp/xbpfontdialog.prg index 2be938f710..8eeb1be397 100644 --- a/harbour/contrib/hbxbp/xbpfontdialog.prg +++ b/harbour/contrib/hbxbp/xbpfontdialog.prg @@ -187,7 +187,7 @@ METHOD XbpFontDialog:create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) ::xbpWindow:create( oParent, oOwner ) - ::oWidget := QFontDialog():new() + ::oWidget := QFontDialog() if !empty( ::title ) ::oWidget:setWindowTitle( ::title ) @@ -241,7 +241,7 @@ METHOD XbpFontDialog:display( nMode ) /* Before Display Initialize the Variables */ - ::oFont := QFont():new() + ::oFont := QFont() ::oFont:setFamily( ::familyName ) IF ::nominalPointSize > 0 @@ -393,10 +393,11 @@ CLASS XbpFont METHOD new( oPS ) METHOD create( cFontName ) METHOD configure( cFontName ) + METHOD destroy() METHOD list() METHOD createFont() - DESTRUCTOR destroy() + DESTRUCTOR _destroy() ENDCLASS @@ -430,7 +431,7 @@ METHOD XbpFont:create( cFontName ) nPtSize := 12 ENDIF - ::oWidget := QFont():new( cFont, nPtSize ) + ::oWidget := QFont( cFont, nPtSize ) ::oWidget:setBold( ::bold ) ::oWidget:setItalic( ::italic ) @@ -463,7 +464,7 @@ METHOD XbpFont:create( cFontName ) //::oWidget:initialize() /* Call the final step - beyond that any changes to properties above will have NO effect */ - ::oFontInfo := QFontInfo():new( ::oWidget ) + ::oFontInfo := QFontInfo( ::oWidget ) /* Reassign actual properties */ ::bold := ::oFontInfo:bold() @@ -502,6 +503,15 @@ METHOD XbpFont:destroy() /*----------------------------------------------------------------------*/ +METHOD XbpFont:_destroy() + + ::oFontInfo:pPtr := NIL + ::oWidget:pPtr := 0 + + RETURN NIL + +/*----------------------------------------------------------------------*/ + METHOD XbpFont:list() LOCAL aList := {} diff --git a/harbour/contrib/hbxbp/xbpgeneric.prg b/harbour/contrib/hbxbp/xbpgeneric.prg index a2d6eb4987..f7d9570efc 100644 --- a/harbour/contrib/hbxbp/xbpgeneric.prg +++ b/harbour/contrib/hbxbp/xbpgeneric.prg @@ -162,9 +162,9 @@ FUNCTION PostAppEvent( nEvent, mp1, mp2, oXbp ) IF nEvent == xbeP_Keyboard IF mp1 == xbeK_TAB - qEvent := QEvent():new( QEvent_KeyPress ) + qEvent := QEvent( QEvent_KeyPress ) //s_oApp:postEvent( oXbp:oWidget, qEvent ) - QApplication():new():postEvent( oXbp:oWidget, qEvent ) + QApplication():postEvent( oXbp:oWidget, qEvent ) ENDIF ENDIF @@ -292,7 +292,7 @@ FUNCTION AppDesktop() IF s_oDeskTop == NIL s_oDeskTop := XbpWindow():new() - s_oDeskTop:oWidget := QDesktopWidget():new() + s_oDeskTop:oWidget := QDesktopWidget() ENDIF RETURN s_oDeskTop @@ -308,7 +308,7 @@ FUNCTION MsgBox( cMsg, cTitle ) cMsg := strtran( cMsg, chr( 13 ), "
" ) cMsg := strtran( cMsg, chr( 10 ), "
" ) - oMB := QMessageBox():new() + oMB := QMessageBox() oMB:setText( /* "" + */ cMsg /* + "" */ ) oMB:setIcon( QMessageBox_Information ) IF hb_isObject( SetAppWindow() ) diff --git a/harbour/contrib/hbxbp/xbphtmlviewer.prg b/harbour/contrib/hbxbp/xbphtmlviewer.prg index d7c3cffc8e..42e9c210e1 100644 --- a/harbour/contrib/hbxbp/xbphtmlviewer.prg +++ b/harbour/contrib/hbxbp/xbphtmlviewer.prg @@ -155,7 +155,7 @@ METHOD XbpHTMLViewer:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) #if 0 /* Discontinued till QWebKit is integrated separately - Pritpal */ - ::oWidget := QWebView():new( ::pParent ) + ::oWidget := QWebView( ::pParent ) ::oWidget:connect( "iconChanged()" , {|p| ::execSlot( "iconChanged()" , p ) } ) ::oWidget:connect( "linkClicked(QUrl)" , {|p| ::execSlot( "linkClicked(QUrl)" , p ) } ) @@ -241,7 +241,7 @@ HB_TRACE( HB_TR_DEBUG, ::cSelectedText ) METHOD XbpHTMLViewer:navigate( cURL ) IF empty( ::oURL ) - ::oURL := QUrl():new() + ::oURL := QUrl() ENDIF ::oURL:setURL( cURL ) diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index c81efd2436..7fcba97066 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -163,7 +163,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF #endif - ::oWidget := QListWidget():New( ::pParent ) + ::oWidget := QListWidget( ::pParent ) ::oWidget:setMouseTracking( .t. ) IF ::markMode == XBPLISTBOX_MM_MULTIPLE ::oWidget:setSelectionMode( QAbstractItemView_MultiSelection ) @@ -336,7 +336,7 @@ METHOD XbpListBox:destroy() /*----------------------------------------------------------------------*/ METHOD XbpListBox:addItem( cItem ) - LOCAL qItm := QListWidgetItem():new() + LOCAL qItm := QListWidgetItem() qItm:setText( cItem ) ; ::oWidget:addItem_1( qItm ) aadd( ::aItems, qItm ) @@ -384,7 +384,7 @@ METHOD XbpListBox:getItem( nIndex ) /*----------------------------------------------------------------------*/ METHOD XbpListBox:insItem( nIndex, cItem ) - LOCAL qItm := QListWidgetItem():new() + LOCAL qItm := QListWidgetItem() qItm:setText( cItem ) @@ -427,17 +427,17 @@ METHOD XbpListBox:setItemColorFG( nIndex, aRGB ) IF hb_isNumeric( nIndex ) .AND. nIndex > 0 .AND. nIndex <= len( ::aItems ) IF ::nOldIndex > 0 .AND. ::nOldIndex <= len( ::aItems ) - ::aItems[ ::nOldIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( 0,0,0 ) ) ) + ::aItems[ ::nOldIndex ]:setForeGround( QBrush( "QColor", QColor( 0,0,0 ) ) ) ENDIF - ::aItems[ nIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) ) + ::aItems[ nIndex ]:setForeGround( QBrush( "QColor", QColor( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) ) ::nOldIndex := nIndex ELSEIF hb_isChar( nIndex ) IF ( nIndex := ascan( ::aItems, {|o| o:text() == nIndex } ) ) > 0 IF ::nOldIndex > 0 .AND. ::nOldIndex <= len( ::aItems ) - ::aItems[ ::nOldIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( 0,0,0 ) ) ) + ::aItems[ ::nOldIndex ]:setForeGround( QBrush( "QColor", QColor( 0,0,0 ) ) ) ENDIF - ::aItems[ nIndex ]:setForeGround( QBrush():new( "QColor", QColor():new( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) ) + ::aItems[ nIndex ]:setForeGround( QBrush( "QColor", QColor( aRGB[ 1 ], aRGB[ 2 ], aRGB[ 3 ] ) ) ) ::nOldIndex := nIndex ENDIF ENDIF diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index 07cc4c2ec6..e066dd864b 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -182,7 +182,7 @@ METHOD xbpMenuBar:create( oParent, aPresParams, lVisible ) ::xbpWindow:create( ::oParent, , , , ::aPresParams, ::visible ) - ::oWidget := QMenuBar():new() + ::oWidget := QMenuBar() ::oParent:oWidget:setMenuBar( ::oWidget ) if !empty( ::oWidget ) @@ -286,7 +286,7 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos ) aItem := { QMF_SEPARATOR, 0, 0, NIL, oAction } CASE cType == "C" - oAction := QAction():new( ::oWidget ) + oAction := QAction( ::oWidget ) cCaption := strtran( xCaption, '~', '&' ) IF ( n := at( '|', cCaption ) ) > 0 cIcon := substr( cCaption, 1, n-1 ) @@ -301,7 +301,7 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos ) oAction:setIcon( cIcon ) ENDIF IF !empty( cKey ) - oKey := QKeySequence():new( cKey ) + oKey := QKeySequence( cKey ) oAction:setShortcut( oKey ) ENDIF @@ -742,7 +742,7 @@ METHOD xbpMenu:create( oParent, aPresParams, lVisible ) ::xbpWindow:create( ::oParent, , , , ::aPresParams, ::visible ) - ::oWidget := QMenu():new() + ::oWidget := QMenu() ::oParent:oWidget:addMenu( ::oWidget ) ::oParent:addChild( self ) diff --git a/harbour/contrib/hbxbp/xbpmle.prg b/harbour/contrib/hbxbp/xbpmle.prg index a857270280..b9a0bee03a 100644 --- a/harbour/contrib/hbxbp/xbpmle.prg +++ b/harbour/contrib/hbxbp/xbpmle.prg @@ -135,7 +135,7 @@ METHOD XbpMLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QPlainTextEdit():new( ::pParent ) + ::oWidget := QPlainTextEdit( ::pParent ) IF !( ::editable ) ::oWidget:setReadOnly( .t. ) diff --git a/harbour/contrib/hbxbp/xbpprintdialog.prg b/harbour/contrib/hbxbp/xbpprintdialog.prg index cfdb78c8b6..abc92231e9 100644 --- a/harbour/contrib/hbxbp/xbpprintdialog.prg +++ b/harbour/contrib/hbxbp/xbpprintdialog.prg @@ -110,7 +110,7 @@ METHOD XbpPrintDialog:create( oParent, oOwner ) ::xbpWindow:create( oParent, oOwner ) - ::oWidget := QPrintDialog():new() + ::oWidget := QPrintDialog() ::oWidget:connect( "accepted(QPrinter)", {|p| ::pPrinter := p } ) diff --git a/harbour/contrib/hbxbp/xbpprinter.prg b/harbour/contrib/hbxbp/xbpprinter.prg index da42bb25b3..581af09981 100644 --- a/harbour/contrib/hbxbp/xbpprinter.prg +++ b/harbour/contrib/hbxbp/xbpprinter.prg @@ -148,7 +148,7 @@ METHOD XbpPrinter:create( cDeviceName, nSpoolFormat, cDeviceParams ) HB_SYMBOL_UNUSED( nSpoolFormat ) HB_SYMBOL_UNUSED( cDeviceParams ) - ::oWidget := QPrinter():new() + ::oWidget := QPrinter() IF hb_isChar( cDeviceName ) ::oWidget:setPrinterName( cDeviceName ) diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index d4952a9de6..8981d300c3 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -119,7 +119,7 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QPushButton():new( ::oParent:oWidget ) + ::oWidget := QPushButton( ::oParent:oWidget ) ::oWidget:setFocusPolicy( Qt_StrongFocus ) ::setPosAndSize() @@ -150,7 +150,7 @@ METHOD XbpPushButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParam ::oWidget:pPtr := pQtObject ELSE - ::oWidget := QPushButton():new( ::oParent:oWidget ) + ::oWidget := QPushButton( ::oParent:oWidget ) ::setPosAndSize() IF ::visible ::oWidget:show() diff --git a/harbour/contrib/hbxbp/xbpradiobutton.prg b/harbour/contrib/hbxbp/xbpradiobutton.prg index d58fc4a4b8..e645d5f2f8 100644 --- a/harbour/contrib/hbxbp/xbpradiobutton.prg +++ b/harbour/contrib/hbxbp/xbpradiobutton.prg @@ -107,7 +107,7 @@ METHOD XbpRadioButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisibl ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QRadioButton():New( ::oParent:oWidget ) + ::oWidget := QRadioButton( ::oParent:oWidget ) ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) diff --git a/harbour/contrib/hbxbp/xbprtf.prg b/harbour/contrib/hbxbp/xbprtf.prg index 0b3afe33bf..b3955349fe 100644 --- a/harbour/contrib/hbxbp/xbprtf.prg +++ b/harbour/contrib/hbxbp/xbprtf.prg @@ -169,7 +169,7 @@ METHOD XbpRtf:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QTextEdit():new( ::pParent ) + ::oWidget := QTextEdit( ::pParent ) * ::oWidget:connect( "copyAvailable(bool)" , {|p| ::execSlot( "copyAvailable(bool)" , p ) } ) ::oWidget:connect( "currentCharFormatChanged(QTextCharFormat)", {|p| ::execSlot( "currentCharFormatChanged(QTextCharFormat)", p ) } ) @@ -490,8 +490,8 @@ METHOD XbpRtf:selColor( ... ) IF ::oTextCharFormat:isValid() xRet := ::oTextCharFormat:foreground() nColor := hbxbp_ConvertAFactFromXBP( "COLOR", aP[ 1 ] ) - oColor := QColor():new( nColor ) - oBrush := QBrush():new( "QColor", oColor ) + oColor := QColor( nColor ) + oBrush := QBrush( "QColor", oColor ) ::oTextCharFormat:setForeground( oBrush ) ::oCurCursor:setCharFormat( ::oTextCharFormat ) ENDIF diff --git a/harbour/contrib/hbxbp/xbpscrollbar.prg b/harbour/contrib/hbxbp/xbpscrollbar.prg index 6658a9eabb..5d1ec2e108 100644 --- a/harbour/contrib/hbxbp/xbpscrollbar.prg +++ b/harbour/contrib/hbxbp/xbpscrollbar.prg @@ -113,7 +113,7 @@ METHOD XbpScrollBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QScrollBar():new( ::pParent ) + ::oWidget := QScrollBar( ::pParent ) ::oWidget:setOrientation( IF( ::type == XBPSCROLL_VERTICAL, 2, 1 ) ) ::oWidget:setTracking( ::autoTrack ) diff --git a/harbour/contrib/hbxbp/xbpsle.prg b/harbour/contrib/hbxbp/xbpsle.prg index 9ff30ad522..9fadaf3b56 100644 --- a/harbour/contrib/hbxbp/xbpsle.prg +++ b/harbour/contrib/hbxbp/xbpsle.prg @@ -145,7 +145,7 @@ METHOD XbpSLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QLineEdit():new( ::pParent ) + ::oWidget := QLineEdit( ::pParent ) ::oWidget:setFocusPolicy( Qt_StrongFocus ) ::oWidget:setAlignment( es_[ ::align ] ) diff --git a/harbour/contrib/hbxbp/xbpspinbutton.prg b/harbour/contrib/hbxbp/xbpspinbutton.prg index 87a1d47376..57cd103e46 100644 --- a/harbour/contrib/hbxbp/xbpspinbutton.prg +++ b/harbour/contrib/hbxbp/xbpspinbutton.prg @@ -138,7 +138,7 @@ METHOD XbpSpinButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QSpinBox():new( ::pParent ) + ::oWidget := QSpinBox( ::pParent ) ::oWidget:setKeyboardTracking( .t. ) IF ::fastSpin ::oWidget:setAccelerated( .t. ) diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg index 9457e6a570..00e2b5e0e9 100644 --- a/harbour/contrib/hbxbp/xbpstatic.prg +++ b/harbour/contrib/hbxbp/xbpstatic.prg @@ -112,7 +112,7 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) DO CASE // OK CASE ::type == XBPSTATIC_TYPE_TEXT - ::oWidget := QLabel():new( ::pParent ) + ::oWidget := QLabel( ::pParent ) IF ( hb_bitAnd( ::options, XBPSTATIC_TEXT_LEFT ) == XBPSTATIC_TEXT_LEFT ) ::oWidget:setAlignment( Qt_AlignLeft ) @@ -137,11 +137,11 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_GROUPBOX - ::oWidget := QGroupBox():new( ::pParent ) + ::oWidget := QGroupBox( ::pParent ) // OK CASE ::type == XBPSTATIC_TYPE_RAISEDBOX - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Raised ) ::setColorBG( GraMakeRGBColor( { 198, 198, 198 } ) ) IF lThick @@ -149,7 +149,7 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_RECESSEDBOX - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Sunken ) ::setColorBG( GraMakeRGBColor( { 198, 198, 198 } ) ) IF lThick @@ -157,48 +157,48 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_RAISEDRECT - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Raised ) IF lThick ::oWidget:setLineWidth( 2 ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_RECESSEDRECT - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Sunken ) IF lThick ::oWidget:setLineWidth( 2 ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_FGNDFRAME // rectangle in foreground color, not filled - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Panel + QFrame_Plain ) ::setColorFG( GraMakeRGBColor( { 0, 0, 0 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_BGNDFRAME - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Box + QFrame_Plain ) ::setColorFG( GraMakeRGBColor( { 127, 127, 127 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_FGNDRECT - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::setColorBG( GraMakeRGBColor( { 0, 0, 0 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_BGNDRECT - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::setColorBG( GraMakeRGBColor( { 127, 127, 127 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_HALFTONERECT - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::setColorBG( GraMakeRGBColor( { 255, 255, 255 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_HALFTONEFRAME - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ::oWidget:setFrameStyle( QFrame_Box + QFrame_Plain ) ::setColorFG( GraMakeRGBColor( { 255, 255, 255 } ) ) // OK CASE ::type == XBPSTATIC_TYPE_RAISEDLINE - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) //IF ::aPos[ 1 ] + ::aSize[ 1 ] >= ::aPos[ 2 ] + ::aSize[ 2 ] IF ::aSize[ 1 ] >= ::aSize[ 2 ] ::oWidget:setFrameStyle( QFrame_HLine + QFrame_Raised ) @@ -210,7 +210,7 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF // OK CASE ::type == XBPSTATIC_TYPE_RECESSEDLINE - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) //IF ::aPos[ 1 ] + ::aSize[ 1 ] >= ::aPos[ 2 ] + ::aSize[ 2 ] IF ::aSize[ 1 ] >= ::aSize[ 2 ] ::oWidget:setFrameStyle( QFrame_HLine + QFrame_Sunken ) @@ -222,17 +222,17 @@ METHOD XbpStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF CASE ::type == XBPSTATIC_TYPE_ICON - ::oWidget := QLabel():new( ::pParent ) + ::oWidget := QLabel( ::pParent ) CASE ::type == XBPSTATIC_TYPE_SYSICON - ::oWidget := QLabel():new( ::pParent ) + ::oWidget := QLabel( ::pParent ) CASE ::type == XBPSTATIC_TYPE_BITMAP - //::oWidget := QFrame():new( ::pParent ) - ::oWidget := QLabel():new( ::pParent ) + //::oWidget := QFrame( ::pParent ) + ::oWidget := QLabel( ::pParent ) OTHERWISE - ::oWidget := QFrame():new( ::pParent ) + ::oWidget := QFrame( ::pParent ) ENDCASE @@ -365,7 +365,7 @@ METHOD XbpStatic:setCaption( xCaption, cDll ) IF ::options == XBPSTATIC_BITMAP_SCALED ::oWidget:setScaledContents( .t. ) ENDIF - ::oWidget:setPixmap( QPixmap():new():fromImage( ::caption:oWidget ) ) + ::oWidget:setPixmap( QPixmap():fromImage( ::caption:oWidget ) ) ELSEIF hb_isChar( ::caption ) /* $HARBOUR$ */ IF ::options == XBPSTATIC_BITMAP_SCALED @@ -376,13 +376,13 @@ METHOD XbpStatic:setCaption( xCaption, cDll ) ENDIF CASE ::type == XBPSTATIC_TYPE_ICON - ::oWidget:setPixmap( QPixmap():new( ::caption ):scaled( ::aSize[ 1 ], ::aSize[ 2 ] ) ) + ::oWidget:setPixmap( QPixmap( ::caption ):scaled( ::aSize[ 1 ], ::aSize[ 2 ] ) ) CASE ::type == XBPSTATIC_TYPE_SYSICON oPixmap := QPixmap() oIcon := QIcon() oStyle := QStyle() - oStyle:pPtr := QApplication():new():style() + oStyle:pPtr := QApplication():style() DO CASE CASE ::caption == XBPSTATIC_SYSICON_ICONINFORMATION diff --git a/harbour/contrib/hbxbp/xbpstatusbar.prg b/harbour/contrib/hbxbp/xbpstatusbar.prg index 44707b8b48..b24eba72ea 100644 --- a/harbour/contrib/hbxbp/xbpstatusbar.prg +++ b/harbour/contrib/hbxbp/xbpstatusbar.prg @@ -123,7 +123,7 @@ METHOD XbpStatusBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ENDIF ::oParent := oPar - ::oWidget := QStatusBar():new() + ::oWidget := QStatusBar() ::oParent:oWidget:setStatusBar( ::oWidget ) ::oWidget:setSizeGripEnabled( ::sizeGrip ) @@ -359,7 +359,7 @@ METHOD XbpStatusBarPanel:create( cCaption, nStyle, cKey ) ::key := cKey // take care of nStyle - later - label right now - ::oWidget := QLabel():new() + ::oWidget := QLabel() RETURN Self diff --git a/harbour/contrib/hbxbp/xbptabpage.prg b/harbour/contrib/hbxbp/xbptabpage.prg index a449b63483..ad107b0b9d 100644 --- a/harbour/contrib/hbxbp/xbptabpage.prg +++ b/harbour/contrib/hbxbp/xbptabpage.prg @@ -135,7 +135,7 @@ METHOD XbpTabPage:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) oPar := ::oParent:oTabWidget - ::oWidget := QWidget():new() + ::oWidget := QWidget() ::oWidget:setContextMenuPolicy( Qt_CustomContextMenu ) ::oWidget:setObjectName( "Tab_Page" ) @@ -281,7 +281,7 @@ METHOD XbpTabWidget:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QTabWidget():new( ::pParent ) + ::oWidget := QTabWidget( ::pParent ) ::oWidget:setContextMenuPolicy( Qt_CustomContextMenu ) ::oWidget:setObjectName( "Tab_Widget" ) @@ -320,7 +320,7 @@ METHOD XbpTabWidget:execSlot( cSlot, p ) IF hb_isPointer( p ) qPoint := QPoint():from( ::oWidget:mapToGlobal( p ) ) - qApp := QApplication():new() + qApp := QApplication() pWidget := QWidget():from( qApp:widgetAt( qPoint ) ) iIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, pWidget:pPtr ) } ) - 1 HB_TRACE( HB_TR_DEBUG, "iIndex", iIndex, pWidget:objectName() ) diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index 233a866b67..463a619029 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -152,13 +152,13 @@ METHOD XbpToolbar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF ::oParent := oPar - ::oWidget := QToolBar():new( ::oParent:oWidget ) + ::oWidget := QToolBar( ::oParent:oWidget ) ::oWidget:setObjectName( "XBPTOOLBARMAIN" ) ::oWidget:setWindowTitle( "Toolbar: Main" ) ::oParent:oWidget:addToolBar_1( ::oWidget ) IF ::imageWidth > 0 .and. ::imageHeight > 0 - ::oWidget:setIconSize( QSize():new( ::imageWidth, ::imageHeight ) ) + ::oWidget:setIconSize( QSize( ::imageWidth, ::imageHeight ) ) ENDIF #if 0 @@ -269,7 +269,7 @@ METHOD XbpToolbar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS ELSE /* Create an action */ - oBtn:oAction := QAction():new( ::oWidget ) + oBtn:oAction := QAction( ::oWidget ) oBtn:oAction:setText( cCaption ) IF valtype( xImage ) == "C" .and. hb_FileExists( xImage ) diff --git a/harbour/contrib/hbxbp/xbptreeview.prg b/harbour/contrib/hbxbp/xbptreeview.prg index aaa739619e..ec22a34010 100644 --- a/harbour/contrib/hbxbp/xbptreeview.prg +++ b/harbour/contrib/hbxbp/xbptreeview.prg @@ -135,7 +135,7 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::oWidget := QTreeWidget():new( ::pParent ) + ::oWidget := QTreeWidget( ::pParent ) ::oWidget:setMouseTracking( .t. ) ::oWidget:setColumnCount( 1 ) ::oWidget:setHeaderHidden( .t. ) @@ -390,7 +390,7 @@ METHOD XbpTreeViewItem:addItem( xItem, xNormalImage, xMarkedImage, xExpandedImag IF valtype( xItem ) == 'C' oItem := XbpTreeViewItem():New() oItem:caption := xItem - oItem:oWidget := QTreeWidgetItem():new() + oItem:oWidget := QTreeWidgetItem() oItem:oWidget:setText( 0, oItem:caption ) ELSE oItem := xItem // aNode @@ -430,7 +430,7 @@ METHOD XbpTreeViewItem:new() METHOD XbpTreeViewItem:create() - ::oWidget := QTreeWidgetItem():new() + ::oWidget := QTreeWidgetItem() ::oWidget:setText( 0,::caption ) RETURN Self diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 9f8008aeda..9a95a9302c 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -857,7 +857,7 @@ METHOD XbpWindow:lockUpdate() /*----------------------------------------------------------------------*/ STATIC FUNCTION Xbp_RgbToName( nRgb ) - LOCAL oColor := QColor():new( nRGB ) + LOCAL oColor := QColor( nRGB ) LOCAL cName := oColor:name RETURN '#'+substr( cName,6 ) + substr( cName,4,2 ) + substr( cName,2,2 ) @@ -911,16 +911,16 @@ METHOD XbpWindow:setColorFG( nRGB ) DO CASE CASE cClass $ 'XBPPUSHBUTTON,XBPMENUBAR,XBPMENU,XBPTOOLBAR,XBPTABPAGE' - ::oPalette:setColor( QPalette_ButtonText, QColor():new( nRGB ) ) + ::oPalette:setColor( QPalette_ButtonText, QColor( nRGB ) ) OTHERWISE - ::oPalette:setColor( QPalette_Foreground, QColor():new( nRGB ) ) - ::oPalette:setColor( QPalette_Text , QColor():new( nRGB ) ) + ::oPalette:setColor( QPalette_Foreground, QColor( nRGB ) ) + ::oPalette:setColor( QPalette_Text , QColor( nRGB ) ) ENDCASE ::oWidget:setPalette( ::oPalette ) ENDIF - LOCAL oColor := QColor():new( nRGB ) + LOCAL oColor := QColor( nRGB ) Xbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB ) ::setStyleSheet( "color: "+ oColor:name +";" ) RETURN Self @@ -1027,66 +1027,66 @@ METHOD XbpWindow:setPointer( cDllName, xResID, nType ) CASE xResID == XBPSTATIC_SYSICON_DEFAULT // Default mouse pointer CASE xResID == XBPSTATIC_SYSICON_ARROW // Normal arrow - ::oWidget:setCursor( QCursor():new( Qt_ArrowCursor ) ) + ::oWidget:setCursor( QCursor( Qt_ArrowCursor ) ) CASE xResID == XBPSTATIC_SYSICON_WAIT // Hour glass or clock - ::oWidget:setCursor( QCursor():new( Qt_WaitCursor ) ) + ::oWidget:setCursor( QCursor( Qt_WaitCursor ) ) CASE xResID == XBPSTATIC_SYSICON_MOVE // Move the window - ::oWidget:setCursor( QCursor():new( Qt_OpenHandCursor ) ) + ::oWidget:setCursor( QCursor( Qt_OpenHandCursor ) ) CASE xResID == XBPSTATIC_SYSICON_SIZE // Change size (all directions) - ::oWidget:setCursor( QCursor():new( Qt_SizeAllCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SizeAllCursor ) ) CASE xResID == XBPSTATIC_SYSICON_SIZENWSE // Change size (North west-South east) - ::oWidget:setCursor( QCursor():new( Qt_SizeFDiagCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SizeFDiagCursor ) ) CASE xResID == XBPSTATIC_SYSICON_SIZENESW // Change size (North east-South west) - ::oWidget:setCursor( QCursor():new( Qt_SizeBDiagCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SizeBDiagCursor ) ) CASE xResID == XBPSTATIC_SYSICON_SIZEWE // Change size (West-East) - ::oWidget:setCursor( QCursor():new( Qt_SizeHorCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SizeHorCursor ) ) CASE xResID == XBPSTATIC_SYSICON_SIZENS // Change size (North-South) - ::oWidget:setCursor( QCursor():new( Qt_SizeVerCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SizeVerCursor ) ) /* Possible Harbour-QT extensions - #deines yet to be finalized */ CASE xResID == Qt_UpArrowCursor - ::oWidget:setCursor( QCursor():new( Qt_UpArrowCursor ) ) + ::oWidget:setCursor( QCursor( Qt_UpArrowCursor ) ) CASE xResID == Qt_CrossCursor - ::oWidget:setCursor( QCursor():new( Qt_CrossCursor ) ) + ::oWidget:setCursor( QCursor( Qt_CrossCursor ) ) CASE xResID == Qt_IBeamCursor - ::oWidget:setCursor( QCursor():new( Qt_IBeamCursor ) ) + ::oWidget:setCursor( QCursor( Qt_IBeamCursor ) ) CASE xResID == Qt_BlankCursor - ::oWidget:setCursor( QCursor():new( Qt_BlankCursor ) ) + ::oWidget:setCursor( QCursor( Qt_BlankCursor ) ) CASE xResID == Qt_SplitVCursor - ::oWidget:setCursor( QCursor():new( Qt_SplitVCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SplitVCursor ) ) CASE xResID == Qt_SplitHCursor - ::oWidget:setCursor( QCursor():new( Qt_SplitHCursor ) ) + ::oWidget:setCursor( QCursor( Qt_SplitHCursor ) ) CASE xResID == Qt_PointingHandCursor - ::oWidget:setCursor( QCursor():new( Qt_PointingHandCursor ) ) + ::oWidget:setCursor( QCursor( Qt_PointingHandCursor ) ) CASE xResID == Qt_ForbiddenCursor - ::oWidget:setCursor( QCursor():new( Qt_ForbiddenCursor ) ) + ::oWidget:setCursor( QCursor( Qt_ForbiddenCursor ) ) CASE xResID == Qt_ClosedHandCursor - ::oWidget:setCursor( QCursor():new( Qt_ClosedHandCursor ) ) + ::oWidget:setCursor( QCursor( Qt_ClosedHandCursor ) ) CASE xResID == Qt_WhatsThisCursor - ::oWidget:setCursor( QCursor():new( Qt_WhatsThisCursor ) ) + ::oWidget:setCursor( QCursor( Qt_WhatsThisCursor ) ) CASE xResID == Qt_BusyCursor - ::oWidget:setCursor( QCursor():new( Qt_BusyCursor ) ) + ::oWidget:setCursor( QCursor( Qt_BusyCursor ) ) CASE xResID == Qt_BitmapCursor - ::oWidget:setCursor( QCursor():new( Qt_BitmapCursor ) ) + ::oWidget:setCursor( QCursor( Qt_BitmapCursor ) ) ENDCASE @@ -1094,9 +1094,9 @@ METHOD XbpWindow:setPointer( cDllName, xResID, nType ) IF valtype( xResID ) == "C" // Harbour compatibility IF file( xResID ) #if 0 /* The original image size - but in practice pointer should be proper sized */ - ::oWidget:setCursor( QCursor():new( "QPixmap", QPixmap():new( xResID ) ) ) + ::oWidget:setCursor( QCursor( "QPixmap", QPixmap( xResID ) ) ) #else - ::oWidget:setCursor( QCursor():new( "QPixmap", QPixmap():new( xResID ):scaled( 24,24 ) ) ) + ::oWidget:setCursor( QCursor( "QPixmap", QPixmap( xResID ):scaled( 24,24 ) ) ) #endif ENDIF ENDIF @@ -1693,13 +1693,13 @@ METHOD XbpWindow:hbLayout( nTypeLayout ) ENDIF DO CASE CASE ::nLayout == HBPLAYOUT_TYPE_HORZBOX - ::qLayout := QHBoxLayout():new() + ::qLayout := QHBoxLayout() CASE ::nLayout == HBPLAYOUT_TYPE_VERTBOX - ::qLayout := QVBoxLayout():new() + ::qLayout := QVBoxLayout() CASE ::nLayout == HBPLAYOUT_TYPE_GRID - ::qLayout := QGridLayout():new() + ::qLayout := QGridLayout() CASE ::nLayout == HBPLAYOUT_TYPE_FORM - ::qLayout := QFormLayout():new() + ::qLayout := QFormLayout() ENDCASE ::oWidget:setLayout( ::qLayout ) FOR EACH oXbp IN ::aChildren