diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4f84c9fcaf..a53ae99c27 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-17 12:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtgui/THbQtUI.prg + * HB_ISOBJECT() -> HBQT_ISOBJECT() + + * contrib/hbqt/qtcore/hbqt_pointer.cpp + * contrib/hbqt/qtcore/hbqtcore.hbx + * contrib/hbqt/qtcore/hbqt_misc.prg + * __HBQT_ISVALIDPOINTER() -> __HBQT_ISPOINTER() + + * contrib/hbqt/qtcore/hbqt_misc.prg + + :from() changed to only accept HBQT objects and else RTE. + * Updated notes. + * Renamed :pSlots -> :__pSlots + * Renamed :pEvents -> :__pEvents + + Made :pSlots and :pEvents PROTECTED. + + Added TODO to rename :pPtr to :__pPtr. + ; Pls test. + + * contrib/hbqt/tests/dialogqt.prg + * Cleanups (:new(), :pptr). No testing made. + 2010-10-16 19:24 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqt_misc.prg ! hbqt_ptr() => __hbqt_ptr() diff --git a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg index 17d597a712..4b1a77f370 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg +++ b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg @@ -57,11 +57,12 @@ CREATE CLASS HbQtObjectHandler - VAR pPtr - VAR pSlots - VAR pEvents + VAR pPtr /* TODO: Rename to __pPtr */ - METHOD from( xObject ) + VAR __pSlots PROTECTED + VAR __pEvents PROTECTED + + METHOD from( oObject ) METHOD fromPointer( pPtr ) METHOD hasValidPointer() @@ -74,14 +75,17 @@ ENDCLASS /*----------------------------------------------------------------------*/ -/* NOTE: Deprecated: passing raw pointers to this function - TODO: Generate RTE when non QT object is passed. - TODO: Move thid to class implementation level so that proper object +/* TODO: Move thid to class implementation level so that proper object type checking can be done. */ -METHOD HbQtObjectHandler:from( xObject ) +METHOD HbQtObjectHandler:from( oObject ) LOCAL pPtr - IF hb_isPointer( pPtr := __hbqt_ptr( xObject ) ) - ::pPtr := pPtr + IF hbqt_isObject( oObject ) + /* TOFIX: Here we should only accept GC collected pointers */ + IF hb_isPointer( pPtr := oObject:pPtr ) + ::pPtr := pPtr + ENDIF + ELSE + __hbqt_Error() ENDIF RETURN Self @@ -103,7 +107,7 @@ METHOD HbQtObjectHandler:fromPointer( pPtr ) into valid .prg level QT objects. Currently it will return .F. for objects created using :fromPointer() */ METHOD HbQtObjectHandler:hasValidPointer() - RETURN __hbqt_IsValidPointer( ::pPtr ) + RETURN __hbqt_isPointer( ::pPtr ) /*----------------------------------------------------------------------*/ @@ -139,18 +143,18 @@ METHOD HbQtObjectHandler:connect( cnEvent, bBlock ) SWITCH ValType( cnEvent ) CASE "C" - IF Empty( ::pSlots ) - ::pSlots := __hbqt_slots_New() + IF Empty( ::__pSlots ) + ::__pSlots := __hbqt_slots_New() ENDIF - RETURN __hbqt_slots_Connect( ::pSlots, ::pPtr, cnEvent, bBlock ) + RETURN __hbqt_slots_Connect( ::__pSlots, ::pPtr, cnEvent, bBlock ) CASE "N" - IF Empty( ::pEvents ) - ::pEvents := __hbqt_events_New() - ::installEventFilter( HBQEventsFromPointer( ::pEvents ) ) + IF Empty( ::__pEvents ) + ::__pEvents := __hbqt_events_New() + ::installEventFilter( HBQEventsFromPointer( ::__pEvents ) ) ENDIF - RETURN __hbqt_events_Connect( ::pEvents, ::pPtr, cnEvent, bBlock ) + RETURN __hbqt_events_Connect( ::__pEvents, ::pPtr, cnEvent, bBlock ) ENDSWITCH @@ -163,15 +167,15 @@ METHOD HbQtObjectHandler:disconnect( cnEvent ) SWITCH ValType( cnEvent ) CASE "C" - IF ! Empty( ::pSlots ) - RETURN __hbqt_slots_Disconnect( ::pSlots, ::pPtr, cnEvent ) + IF ! Empty( ::__pSlots ) + RETURN __hbqt_slots_Disconnect( ::__pSlots, ::pPtr, cnEvent ) ENDIF EXIT CASE "N" - IF ! Empty( ::pEvents ) - RETURN __hbqt_events_Disconnect( ::pEvents, ::pPtr, cnEvent ) + IF ! Empty( ::__pEvents ) + RETURN __hbqt_events_Disconnect( ::__pEvents, ::pPtr, cnEvent ) ENDIF EXIT diff --git a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp index 814f2a2a28..44567aa7e1 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp @@ -251,7 +251,7 @@ void * hbqt_detachgcpointer( int iParam ) } } -HB_FUNC( __HBQT_ISVALIDPOINTER ) +HB_FUNC( __HBQT_ISPOINTER ) { HBQT_GC_T * p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); diff --git a/harbour/contrib/hbqt/qtcore/hbqtcore.hbx b/harbour/contrib/hbqt/qtcore/hbqtcore.hbx index 0281e91085..c3881cf670 100644 --- a/harbour/contrib/hbqt/qtcore/hbqtcore.hbx +++ b/harbour/contrib/hbqt/qtcore/hbqtcore.hbx @@ -255,7 +255,7 @@ DYNAMIC __HBQT_ERROR DYNAMIC __HBQT_EVENTS_CONNECT DYNAMIC __HBQT_EVENTS_DISCONNECT DYNAMIC __HBQT_EVENTS_NEW -DYNAMIC __HBQT_ISVALIDPOINTER +DYNAMIC __HBQT_ISPOINTER DYNAMIC __HBQT_PTR DYNAMIC __HBQT_SLOTS_CONNECT DYNAMIC __HBQT_SLOTS_DISCONNECT diff --git a/harbour/contrib/hbqt/qtgui/THbQtUI.prg b/harbour/contrib/hbqt/qtgui/THbQtUI.prg index b79e23eabf..0155c492e0 100644 --- a/harbour/contrib/hbqt/qtgui/THbQtUI.prg +++ b/harbour/contrib/hbqt/qtgui/THbQtUI.prg @@ -188,7 +188,7 @@ METHOD HbQtUI:loadWidgets() bBlock := &( cBlock ) x := eval( bBlock ) - IF hb_isObject( x ) + IF hbqt_isObject( x ) x:pPtr := pPtr ::qObj[ a_[ 2 ] ] := x ENDIF diff --git a/harbour/contrib/hbqt/tests/dialogqt.prg b/harbour/contrib/hbqt/tests/dialogqt.prg index ebbd413e59..639058908d 100644 --- a/harbour/contrib/hbqt/tests/dialogqt.prg +++ b/harbour/contrib/hbqt/tests/dialogqt.prg @@ -91,25 +91,6 @@ FUNCTION My_Events() /*----------------------------------------------------------------------*/ -FUNCTION xReleaseMemory( aObj ) - #if 1 - LOCAL i -HB_TRACE( HB_TR_ALWAYS, ( "----------------- Releasing Memory -----------------" ) ) - FOR i := 1 TO len( aObj ) - IF hb_isObject( aObj[ i ] ) - aObj[ i ]:pPtr := 1 - ELSEIF hb_isArray( aObj[ i ] ) - xReleaseMemory( aObj[ i ] ) - ENDIF - NEXT -HB_TRACE( HB_TR_ALWAYS, ( "------------------ Memory Released ------------------" ) ) - #else - HB_SYMBOL_UNUSED( aObj ) - #endif - RETURN nil - -/*----------------------------------------------------------------------*/ - PROCEDURE ExecOneMore() Local oLabel, oBtn, oDA, oWnd, oProg, oSBar LOCAL aMenu, aTool, aGrid, aTabs, aList, oEventLoop @@ -118,7 +99,7 @@ PROCEDURE ExecOneMore() s_events := __HBQT_EVENTS_NEW() s_slots := __HBQT_SLOTS_NEW() - oWnd := QMainWindow():new() + oWnd := QMainWindow() __HBQT_EVENTS_CONNECT( s_events, oWnd, QEvent_Close, {|| lExit := .t. } ) oWnd:setMouseTracking( .t. ) @@ -126,7 +107,7 @@ PROCEDURE ExecOneMore() oWnd:setWindowIcon( "test" ) oWnd:resize( 900, 500 ) - oDA := QWidget():new( oWnd ) + oDA := QWidget( oWnd ) oWnd:setCentralWidget( oDA ) oWnd:show() @@ -141,11 +122,11 @@ PROCEDURE ExecOneMore() oProg := Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) aList := Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) - oSBar := QStatusBar():new( oWnd ) + oSBar := QStatusBar( oWnd ) oWnd:setStatusBar( oSBar ) oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) - oEventLoop := QEventLoop():new( oWnd ) + oEventLoop := QEventLoop( oWnd ) DO WHILE .t. oEventLoop:processEvents() IF lExit @@ -156,8 +137,6 @@ PROCEDURE ExecOneMore() oEventLoop:exit( 0 ) oEventLoop := 0 - xReleaseMemory( { oBtn, oLabel, oProg, oSBar, aGrid, aList, aMenu, aTool, aTabs, oDA, oWnd, oEventLoop } ) - HB_GCALL( .T.) RETURN /*----------------------------------------------------------------------*/ @@ -165,10 +144,10 @@ PROCEDURE ExecOneMore() STATIC FUNCTION Build_MenuBar( oWnd ) LOCAL oMenuBar, oMenu1, oMenu2 - oMenuBar := QMenuBar():new() + oMenuBar := QMenuBar() oMenuBar:resize( oWnd:width(), 25 ) - oMenu1 := QMenu():new() + oMenu1 := QMenu() oMenu1:setTitle( "&File" ) __HBQT_SLOTS_CONNECT( s_slots, oMenu1:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) __HBQT_SLOTS_CONNECT( s_slots, oMenu1:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } ) @@ -178,7 +157,7 @@ STATIC FUNCTION Build_MenuBar( oWnd ) __HBQT_SLOTS_CONNECT( s_slots, oMenu1:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| w := w, l := l, MsgInfo( "Exit ?" ) } ) oMenuBar:addMenu( oMenu1 ) - oMenu2 := QMenu():new() + oMenu2 := QMenu() oMenu2:setTitle( "&Dialogs" ) __HBQT_SLOTS_CONNECT( s_slots, oMenu2:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) __HBQT_SLOTS_CONNECT( s_slots, oMenu2:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) @@ -202,10 +181,10 @@ STATIC FUNCTION Build_ToolBar( oWnd ) LOCAL oTB, oActNew, oActOpen, oActSave /* Create a Toolbar Object */ - oTB := QToolBar():new() + oTB := QToolBar() /* Create an action */ - oActNew := QAction():new( oWnd ) + oActNew := QAction( oWnd ) oActNew:setText( "&New" ) oActNew:setIcon( "new.png" ) oActNew:setToolTip( "A New File" ) @@ -215,7 +194,7 @@ STATIC FUNCTION Build_ToolBar( oWnd ) oTB:addAction( oActNew ) /* Create another action */ - oActOpen := QAction():new( oWnd ) + oActOpen := QAction( oWnd ) oActOpen:setText( "&Open" ) oActOpen:setIcon( "open.png" ) oActOpen:setToolTip( "Select a file to be opened!" ) @@ -227,7 +206,7 @@ STATIC FUNCTION Build_ToolBar( oWnd ) oTB:addSeparator() /* Create another action */ - oActSave := QAction():new( oWnd ) + oActSave := QAction( oWnd ) oActSave:setText( "&Save" ) oActSave:setIcon( "save.png" ) oActSave:setToolTip( "Save this file!" ) @@ -242,15 +221,15 @@ STATIC FUNCTION Build_ToolBar( oWnd ) /////////////////////////////////////////////////////////// #if 0 /* Build another toolbar - we will have two toolbats now */ - oTB := QToolBar():new( oWnd ) + oTB := QToolBar( oWnd ) - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&Colors" ) oAct:setToolTip( "Colors Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors", w, l ) } ) oTB:addAction( oAct ) - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&Fonts" ) oAct:setToolTip( "Fonts Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts", w, l ) } ) @@ -258,13 +237,13 @@ STATIC FUNCTION Build_ToolBar( oWnd ) oTB:addSeparator() - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&PgSetup" ) oAct:setToolTip( "Page Setup Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) oTB:addAction( oAct ) - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&Preview" ) oAct:setToolTip( "Page Preview Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview", w, l ) } ) @@ -272,19 +251,19 @@ STATIC FUNCTION Build_ToolBar( oWnd ) oTB:addSeparator() - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&Webpage" ) oAct:setToolTip( "Web Browser Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage", w, l ) } ) oTB:addAction( oAct ) - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&Wizard" ) oAct:setToolTip( "Generic Wizard Dialog" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard", w, l ) } ) oTB:addAction( oAct ) - oAct := QAction():new( oWnd ) + oAct := QAction( oWnd ) oAct:setText( "&SystemTray" ) oAct:setToolTip( "Show in System Tray!" ) __HBQT_SLOTS_CONNECT( s_slots, oAct, QT_EVE_TRIGGERED_B, {|w,l| ShowInSystemTray( oWnd, w, l ) } ) @@ -303,7 +282,7 @@ STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize, cLabel, cMsg, lExit ) DEFAULT cLabel TO "Push Button" DEFAULT cMsg TO "Push Button Pressed" - oBtn := QPushButton():new( oWnd ) + oBtn := QPushButton( oWnd ) oBtn:setText( cLabel ) oBtn:move( aPos[ 1 ],aPos[ 2 ] ) oBtn:resize( aSize[ 1 ],aSize[ 2 ] ) @@ -321,18 +300,18 @@ STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize, cLabel, cMsg, lExit ) STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) LOCAL oGrid, oBrushBackItem0x0, oBrushForeItem0x0, oGridItem0x0 - oGrid := QTableWidget():new( oWnd ) + oGrid := QTableWidget( oWnd ) oGrid:setRowCount( 2 ) oGrid:setColumnCount( 4 ) // - oBrushBackItem0x0 := QBrush():new() + oBrushBackItem0x0 := QBrush() oBrushBackItem0x0:setStyle( 1 ) // Solid Color oBrushBackItem0x0:setColor_1( 10 ) // http://doc.qtsoftware.com/4.5/qt.html#GlobalColor-enum // - oBrushForeItem0x0 := QBrush():new() + oBrushForeItem0x0 := QBrush() oBrushForeItem0x0:setColor_1( 7 ) // - oGridItem0x0 := QTableWidgetItem():new() + oGridItem0x0 := QTableWidgetItem() oGridItem0x0:setBackground( oBrushBackItem0x0 ) oGridItem0x0:setForeground( oBrushForeItem0x0 ) oGridItem0x0:setText( "Item 0x0" ) @@ -351,11 +330,11 @@ STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) LOCAL oTabWidget, oTab1, oTab2, oTab3, aTree, aCntl, aText - oTabWidget := QTabWidget():new( oWnd ) + oTabWidget := QTabWidget( oWnd ) - oTab1 := QWidget():new() - oTab2 := QWidget():new() - oTab3 := QWidget():new() + oTab1 := QWidget() + oTab2 := QWidget() + oTab3 := QWidget() oTabWidget:addTab( oTab1, "Folders" ) oTabWidget:addTab( oTab2, "Controls" ) @@ -379,10 +358,10 @@ STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) STATIC FUNCTION Build_TreeView( oWnd ) LOCAL oTV, oDirModel - oTV := QTreeView():new( oWnd ) + oTV := QTreeView( oWnd ) oTV:setMouseTracking( .t. ) * __HBQT_SLOTS_CONNECT( s_slots, oTV, QT_EVE_HOVERED, {|i| HB_TRACE( HB_TR_ALWAYS, ( "oTV:hovered" ) } ) - oDirModel := QDirModel():new() + oDirModel := QDirModel() oTV:setModel( oDirModel ) oTV:move( 5, 7 ) oTV:resize( 345, 365 ) @@ -395,11 +374,11 @@ STATIC FUNCTION Build_TreeView( oWnd ) STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) LOCAL oListBox, oStrList, oStrModel - oListBox := QListView():New( oWnd ) + oListBox := QListView( oWnd ) oListBox:setMouseTracking( .t. ) * __HBQT_SLOTS_CONNECT( s_slots, oListBox, QT_EVE_HOVERED, {|i| HB_TRACE( HB_TR_ALWAYS, ( "oListBox:hovered" ) } ) - oStrList := QStringList():new() + oStrList := QStringList() oStrList:append( "India" ) oStrList:append( "United States" ) @@ -410,7 +389,7 @@ STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) oStrList:append( "China" ) oStrList:sort() - oStrModel := QStringListModel():new() + oStrModel := QStringListModel() oStrModel:setStringList( oStrList ) oListBox:setModel( oStrModel ) @@ -425,7 +404,7 @@ STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) STATIC FUNCTION Build_TextBox( oWnd ) LOCAL oTextBox - oTextBox := QTextEdit():new( oWnd ) + oTextBox := QTextEdit( oWnd ) oTextBox:Move( 5, 7 ) oTextBox:Resize( 345,365 ) oTextBox:setAcceptRichText( .t. ) @@ -439,7 +418,7 @@ STATIC FUNCTION Build_TextBox( oWnd ) STATIC FUNCTION Build_Controls( oWnd ) LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton - oEdit := QLineEdit():new( oWnd ) + oEdit := QLineEdit( oWnd ) __HBQT_SLOTS_CONNECT( s_slots, oEdit, QT_EVE_RETURNPRESSED, {|i| i := i, MsgInfo( oEdit:text() ) } ) oEdit:move( 5, 10 ) oEdit:resize( 345, 30 ) @@ -448,7 +427,7 @@ STATIC FUNCTION Build_Controls( oWnd ) oEdit:setAlignment( 1 ) // 1: Left 2: Right 4: center 8: use all textbox length oEdit:show() - oComboBox := QComboBox():New( oWnd ) + oComboBox := QComboBox( oWnd ) oComboBox:addItem( "First" ) oComboBox:addItem( "Second" ) oComboBox:addItem( "Third" ) @@ -457,19 +436,19 @@ STATIC FUNCTION Build_Controls( oWnd ) oComboBox:resize( 345, 30 ) oComboBox:show() - oCheckBox := QCheckBox():New( oWnd ) + oCheckBox := QCheckBox( oWnd ) __HBQT_SLOTS_CONNECT( s_slots, oCheckBox, QT_EVE_STATECHANGED_I, {|i| i := i, MsgInfo( IF( i == 0,"Uncheckd","Checked" ) ) } ) oCheckBox:setText( "Testing CheckBox HbQt" ) oCheckBox:move( 5, 110 ) oCheckBox:resize( 345, 30 ) oCheckBox:show() - oSpinBox := QSpinBox():New( oWnd ) + oSpinBox := QSpinBox( oWnd ) oSpinBox:Move( 5, 160 ) oSpinBox:ReSize( 345, 30 ) oSpinBox:Show() - oRadioButton := QRadioButton():New( oWnd ) + oRadioButton := QRadioButton( oWnd ) __HBQT_SLOTS_CONNECT( s_slots, oRadioButton, QT_EVE_CLICKED, {|i| i := i, MsgInfo( "Checked" ) } ) oRadioButton:Move( 5, 210 ) oRadioButton:ReSize( 345, 30 ) @@ -482,7 +461,7 @@ STATIC FUNCTION Build_Controls( oWnd ) STATIC FUNCTION Build_ProgressBar( oWnd, aPos, aSize ) LOCAL oProgressBar - oProgressBar := QProgressBar():New( oWnd ) + oProgressBar := QProgressBar( oWnd ) oProgressBar:SetRange( 1, 1500 ) oProgressBar:Setvalue( 500 ) oProgressBar:Move( aPos[ 1 ], aPos[ 2 ] ) @@ -496,7 +475,7 @@ STATIC FUNCTION Build_ProgressBar( oWnd, aPos, aSize ) STATIC FUNCTION Build_Label( oWnd, aPos, aSize ) LOCAL oLabel - oLabel := QLabel():New( oWnd ) + oLabel := QLabel( oWnd ) oLabel:SetTextFormat( 1 ) // 0 text plain 1 RichText oLabel:SetText( [This is a Label in Harbour QT] ) oLabel:Move( aPos[ 1 ], aPos[ 2 ] ) @@ -510,7 +489,7 @@ STATIC FUNCTION Build_Label( oWnd, aPos, aSize ) STATIC FUNCTION MsgInfo( cMsg ) LOCAL oMB - oMB := QMessageBox():new() + oMB := QMessageBox() oMB:setInformativeText( cMsg ) oMB:setWindowTitle( "Harbour-QT" ) oMB:exec() @@ -525,7 +504,7 @@ STATIC FUNCTION MsgInfo( cMsg ) STATIC FUNCTION FileDialog() LOCAL oFD - oFD := QFileDialog():new() + oFD := QFileDialog() oFD:setWindowTitle( "Select a File" ) oFD:exec() @@ -541,32 +520,32 @@ STATIC FUNCTION Dialogs( cType ) DO CASE CASE cType == "PageSetup" - oDlg := QPageSetupDialog():new() + oDlg := QPageSetupDialog() oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) oDlg:exec() CASE cType == "Preview" - oDlg := QPrintPreviewDialog():new() + oDlg := QPrintPreviewDialog() oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) oDlg:exec() CASE cType == "Wizard" - oDlg := QWizard():new() + oDlg := QWizard() oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) oDlg:exec() CASE cType == "Colors" - oDlg := QColorDialog():new() + oDlg := QColorDialog() oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) oDlg:exec() CASE cType == "WebPage" #if 0 // Till we resolve for oDlg:show() - oDlg := QWebView():new() - oUrl := QUrl():new() + oDlg := QWebView() + oUrl := QUrl() oUrl:setUrl( "http://www.harbour.vouch.info" ) - QT_QWebView_SetUrl( oDlg:pPtr, oUrl:pPtr ) + oDlg:SetUrl( oUrl ) oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) oDlg:exec() #endif CASE cType == "Fonts" - oDlg := QFontDialog():new() + oDlg := QFontDialog() oDlg:setWindowTitle( "Harbour-QT Font Selector" ) oDlg:exec() ENDCASE @@ -586,258 +565,19 @@ PROCEDURE hb_GtSys() #endif #endif -/*----------------------------------------------------------------------*/ -/* - * Just to Link Every New Widget - */ -STATIC FUNCTION Dummies() - #if 0 - LOCAL oSome - - HB_SYMBOL_UNUSED( oSome ) - - oSome := QAbstractButton():new() - oSome := QAbstractItemModel():new() - oSome := QAbstractItemView():new() - oSome := QAbstractListModel():new() - oSome := QAbstractPrintDialog():new() - oSome := QAbstractScrollArea():new() - oSome := QAbstractSlider():new() - oSome := QAbstractSpinBox():new() - oSome := QAbstractTableModel():new() - oSome := QAction():new() - oSome := QApplication():new() - oSome := QBitmap():new() - oSome := QBoxLayout():new() - oSome := QBrush():new() - oSome := QButtonGroup():new() - oSome := QCalendarWidget():new() - oSome := QCheckBox():new() - oSome := QClipboard():new() - oSome := QColor():new() - oSome := QColorDialog():new() - oSome := QComboBox():new() - oSome := QCommandLinkButton():new() - oSome := QCommonStyle():new() - oSome := QConicalGradient():new() - oSome := QCoreApplication():new() - oSome := QCursor():new() - oSome := QDateEdit():new() - oSome := QDateTime():new() - oSome := QDateTimeEdit():new() - oSome := QDesktopWidget():new() - oSome := QDial():new() - oSome := QDialog():new() - oSome := QDir():new() - oSome := QDirModel():new() - oSome := QDockWidget():new() - oSome := QDoubleSpinBox():new() - oSome := QDropEvent():new() - oSome := QDragMoveEvent():new() - oSome := QDragEnterEvent():new() - oSome := QDragLeaveEvent():new() - oSome := QErrorMessage():new() - oSome := QEvent():new() - oSome := QEventLoop():new() - oSome := QFileDialog():new() - oSome := QFileSystemModel():new() - oSome := QFocusEvent():new() - oSome := QFocusFrame():new() - oSome := QFont():new() - oSome := QFontComboBox():new() - oSome := QFontDatabase():new() - oSome := QFontDialog():new() - oSome := QFontInfo():new() - oSome := QFontMetrics():new() - oSome := QFontMetricsF():new() - oSome := QFormLayout():new() - oSome := QFrame():new() - oSome := QFtp():new() - oSome := QGradient():new() - oSome := QGridLayout():new() - oSome := QGroupBox():new() - oSome := QHBoxLayout():new() - oSome := QHeaderView():new() - oSome := QHttp():new() - oSome := QIcon():new() - oSome := QImage():new() - oSome := QImageReader():new() - oSome := QImageWriter():new() - oSome := QInputDialog():new() - oSome := QInputEvent():new() - oSome := QIODevice():new() - oSome := QKeyEvent():new() - oSome := QKeySequence():new() - oSome := QLabel():new() - oSome := QLatin1Char():new() - oSome := QLatin1String():new() - oSome := QLayout():new() - oSome := QLayoutItem():new() - oSome := QLCDNumber():new() - oSome := QLine():new() - oSome := QLinearGradient():new() - oSome := QLineEdit():new() - oSome := QList():new() - oSome := QListView():new() - oSome := QListWidget():new() - oSome := QListWidgetItem():new() - oSome := QMainWindow():new() - oSome := QMenu():new() - oSome := QMenuBar():new() - oSome := QMessageBox():new() - oSome := QModelIndex():new() - oSome := QMouseEvent():new() - oSome := QMoveEvent():new() - oSome := QObject():new() - oSome := QPaintDevice():new() - oSome := QPageSetupDialog():new() - oSome := QPainter():new() - oSome := QPaintEvent():new() - oSome := QPalette():new() - oSome := QPen():new() - oSome := QPicture():new() - oSome := QPixmap():new() - oSome := QPoint():new() - oSome := QPointF():new() - oSome := QPrintDialog():new() - oSome := QPrintEngine():new() - oSome := QPrinter():new() - oSome := QPrintPreviewDialog():new() - oSome := QProcess():new() - oSome := QProgressBar():new() - oSome := QProgressDialog():new() - oSome := QPushButton():new() - oSome := QRadialGradient():new() - oSome := QRadioButton():new() - oSome := QRect():new() - oSome := QRectF():new() - oSome := QRegion():new() - oSome := QResizeEvent():new() - oSome := QResource():new() - oSome := QScrollArea():new() - oSome := QScrollBar():new() - oSome := QSignalMapper():new() - oSome := QSize():new() - oSome := QSizeF():new() - oSome := QSizeGrip():new() - oSome := QSizePolicy():new() - oSome := QSlider():new() - oSome := QSound():new() - oSome := QSpinBox():new() - oSome := QSplashScreen():new() - oSome := QSplitter():new() - oSome := QStandardItem():new() - oSome := QStandardItemModel():new() - oSome := QStatusBar():new() - oSome := QStringList():new() - oSome := QStringListModel():new() - oSome := QStyle():new() - oSome := QStyledItemDelegate():new() - oSome := QStyleFactory():new() - oSome := QStyleHintReturn():new() - oSome := QStyleHintReturnMask():new() - oSome := QStyleHintReturnVariant():new() - oSome := QStyleOption():new() - oSome := QStyleOptionButton():new() - oSome := QStyleOptionComboBox():new() - oSome := QStyleOptionComplex():new() - oSome := QStyleOptionDockWidget():new() - oSome := QStyleOptionFocusRect():new() - oSome := QStyleOptionFrame():new() - oSome := QStyleOptionGroupBox():new() - oSome := QStyleOptionHeader():new() - oSome := QStyleOptionMenuItem():new() - oSome := QStyleOptionProgressBar():new() - oSome := QStyleOptionSizeGrip():new() - oSome := QStyleOptionSlider():new() - oSome := QStyleOptionSpinBox():new() - oSome := QStyleOptionTab():new() - oSome := QStyleOptionTabBarBase():new() - oSome := QStyleOptionTabWidgetFrame():new() - oSome := QStyleOptionTitleBar():new() - oSome := QStyleOptionToolBar():new() - oSome := QStyleOptionToolBox():new() - oSome := QStyleOptionToolButton():new() - oSome := QStyleOptionViewItem():new() - oSome := QStylePainter():new() - oSome := QSystemTrayIcon():new() - oSome := QTabBar():new() - oSome := QTableView():new() - oSome := QTableWidget():new() - oSome := QTableWidgetItem():new() - oSome := QTabWidget():new() - oSome := QTextBlock():new() - oSome := QTextBlockFormat():new() - oSome := QTextBlockGroup():new() - oSome := QTextBrowser():new() - oSome := QTextBoundaryFinder():new() - oSome := QTextCharFormat():new() - oSome := QTextCodec():new() - oSome := QTextCursor():new() - oSome := QTextDecoder():new() - oSome := QTextDocument():new() - oSome := QTextDocumentFragment():new() - oSome := QTextDocumentWriter():new() - oSome := QTextEdit():new() - oSome := QTextEncoder():new() - oSome := QTextFormat():new() - oSome := QTextFragment():new() - oSome := QTextFrame():new() - oSome := QTextFrameFormat():new() - oSome := QTextImageFormat():new() - oSome := QTextInlineObject():new() - oSome := QTextItem():new() - oSome := QTextLayout():new() - oSome := QTextLength():new() - oSome := QTextLine():new() - oSome := QTextObject():new() - oSome := QTextStream():new() - oSome := QTimeEdit():new() - oSome := QTimer():new() - oSome := QToolBar():new() - oSome := QToolBox():new() - oSome := QToolButton():new() - oSome := QTreeView():new() - oSome := QTreeWidget():new() - oSome := QTreeWidgetItem():new() - oSome := QUrl():new() - oSome := QVariant():new() - oSome := QVBoxLayout():new() - oSome := QWebFrame():new() - oSome := QWebHistory():new() - oSome := QWebHistoryInterface():new() - oSome := QWebHistoryItem():new() - oSome := QWebHitTestResult():new() - oSome := QWebPage():new() - oSome := QWebPluginFactory():new() - oSome := QWebSecurityOrigin():new() - oSome := QWebSettings():new() - oSome := QWebView():new() - oSome := QWheelEvent():new() - oSome := QWidget():new() - oSome := QWidgetAction():new() - oSome := QWidgetItem():new() - oSome := QWindowsStyle():new() - oSome := QWindowsXPStyle():new() - oSome := QWizard():new() - - oSome := 1 - #endif - RETURN nil - /*----------------------------------------------------------------------*/ FUNCTION ShowInSystemTray( oWnd ) LOCAL oSys LOCAL oMenu - oMenu := QMenu():new( oWnd ) + oMenu := QMenu( oWnd ) oMenu:setTitle( "&File" ) __HBQT_SLOTS_CONNECT( s_slots, oMenu:addAction_1( "new.png" , "&Show" ), QT_EVE_TRIGGERED_B, {|| oWnd:show() } ) oMenu:addSeparator() __HBQT_SLOTS_CONNECT( s_slots, oMenu:addAction_1( "save.png", "&Hide" ), QT_EVE_TRIGGERED_B, {|| oWnd:hide() } ) - oSys := QSystemTrayIcon():new( oWnd ) + oSys := QSystemTrayIcon( oWnd ) oSys:setIcon( 'new.png' ) oSys:setContextMenu( oMenu ) oSys:showMessage( "Harbour-QT", "This is Harbour-QT System Tray" )