From 0fb9a4bae894940d8b30fb8997c4efabf6bb9e39 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 1 Mar 2011 14:36:22 +0000 Subject: [PATCH] 2011-03-01 15:35 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * examples/hbqt_tut/win01.prg * examples/hbqt_tut/win10.prg * examples/hbqt_tut/win20.prg * examples/hbqt_tut/win02.prg * examples/hbqt_tut/win11.prg + examples/hbqt_tut/win02a.prg * examples/hbqt_tut/win21.prg * examples/hbqt_tut/win12.prg * examples/hbqt_tut/win03.prg * examples/hbqt_tut/win22.prg * examples/hbqt_tut/win13.prg * examples/hbqt_tut/win04.prg * examples/hbqt_tut/win05.prg * examples/hbqt_tut/win23.prg * examples/hbqt_tut/win14.prg * examples/hbqt_tut/win06.prg * examples/hbqt_tut/win15.prg * examples/hbqt_tut/win07.prg * examples/hbqt_tut/win16.prg * examples/hbqt_tut/win08.prg * examples/hbqt_tut/win17.prg * examples/hbqt_tut/win09.prg * examples/hbqt_tut/win18.prg * examples/hbqt_tut/win19.prg * Update [Marco Bra] --- harbour/ChangeLog | 27 +++++++++++++++++++++++++++ harbour/examples/hbqt_tut/win01.prg | 10 ++++++---- harbour/examples/hbqt_tut/win02.prg | 13 ++++++++----- harbour/examples/hbqt_tut/win02a.prg | 22 ++++++++++++++++++++++ harbour/examples/hbqt_tut/win03.prg | 17 ++++++++++------- harbour/examples/hbqt_tut/win04.prg | 9 ++++++--- harbour/examples/hbqt_tut/win05.prg | 12 ++++++++---- harbour/examples/hbqt_tut/win06.prg | 15 +++++++++------ harbour/examples/hbqt_tut/win07.prg | 12 +++++++----- harbour/examples/hbqt_tut/win08.prg | 16 ++++++++-------- harbour/examples/hbqt_tut/win09.prg | 10 ++++++---- harbour/examples/hbqt_tut/win10.prg | 13 ++++++++++--- harbour/examples/hbqt_tut/win11.prg | 6 ++++-- harbour/examples/hbqt_tut/win12.prg | 1 - harbour/examples/hbqt_tut/win13.prg | 13 ++++++++----- harbour/examples/hbqt_tut/win14.prg | 8 +++++--- harbour/examples/hbqt_tut/win15.prg | 12 ++++++++---- harbour/examples/hbqt_tut/win16.prg | 11 +++++++---- harbour/examples/hbqt_tut/win17.prg | 19 +++++++++++++------ harbour/examples/hbqt_tut/win18.prg | 11 ++++++++--- harbour/examples/hbqt_tut/win19.prg | 12 ++++++++---- harbour/examples/hbqt_tut/win20.prg | 14 +++++++++++--- harbour/examples/hbqt_tut/win21.prg | 10 ++++------ harbour/examples/hbqt_tut/win22.prg | 18 +++++++++++++----- harbour/examples/hbqt_tut/win23.prg | 13 ++++++------- 25 files changed, 222 insertions(+), 102 deletions(-) create mode 100644 harbour/examples/hbqt_tut/win02a.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c4501506ae..8f0f709939 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,33 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-01 15:35 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * examples/hbqt_tut/win01.prg + * examples/hbqt_tut/win10.prg + * examples/hbqt_tut/win20.prg + * examples/hbqt_tut/win02.prg + * examples/hbqt_tut/win11.prg + + examples/hbqt_tut/win02a.prg + * examples/hbqt_tut/win21.prg + * examples/hbqt_tut/win12.prg + * examples/hbqt_tut/win03.prg + * examples/hbqt_tut/win22.prg + * examples/hbqt_tut/win13.prg + * examples/hbqt_tut/win04.prg + * examples/hbqt_tut/win05.prg + * examples/hbqt_tut/win23.prg + * examples/hbqt_tut/win14.prg + * examples/hbqt_tut/win06.prg + * examples/hbqt_tut/win15.prg + * examples/hbqt_tut/win07.prg + * examples/hbqt_tut/win16.prg + * examples/hbqt_tut/win08.prg + * examples/hbqt_tut/win17.prg + * examples/hbqt_tut/win09.prg + * examples/hbqt_tut/win18.prg + * examples/hbqt_tut/win19.prg + * Update [Marco Bra] + 2011-03-01 14:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbformat/hbfmtcls.prg ! Fixed a call to deleted function. diff --git a/harbour/examples/hbqt_tut/win01.prg b/harbour/examples/hbqt_tut/win01.prg index 6fee32c5fc..6508195096 100644 --- a/harbour/examples/hbqt_tut/win01.prg +++ b/harbour/examples/hbqt_tut/win01.prg @@ -1,14 +1,16 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) - oWnd:resize( 640, 480 ) + oWnd:resize( 300, 200 ) + oWnd:show() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win02.prg b/harbour/examples/hbqt_tut/win02.prg index 36f066c0d2..839820f5fb 100644 --- a/harbour/examples/hbqt_tut/win02.prg +++ b/harbour/examples/hbqt_tut/win02.prg @@ -1,20 +1,23 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd -STATIC calendario - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL calendario + s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) - oWnd:resize( 640, 480 ) + oWnd:resize( 400, 300 ) + calendario := QCalendarWidget( oWnd ) calendario:resize( 250, 200 ) calendario:move( 50, 50 ) calendario:setFirstDayOfWeek( 1 ) calendario:setGridVisible( .T. ) + oWnd:show() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win02a.prg b/harbour/examples/hbqt_tut/win02a.prg new file mode 100644 index 0000000000..ec9f915a26 --- /dev/null +++ b/harbour/examples/hbqt_tut/win02a.prg @@ -0,0 +1,22 @@ +#include "hbqtgui.ch" + +PROCEDURE Main() + + LOCAL s_qApp + LOCAL oWnd + LOCAL testo + + s_qApp := QApplication() + + oWnd := QMainWindow() + oWnd:setWindowTitle( "Finestra di Giovanni" ) + oWnd:resize( 300, 200 ) + + testo := Qlabel( oWnd ) + testo:setText( "Hello World" ) + testo:move( 100, 100 ) + + oWnd:show() + s_qApp:exec() + + RETURN diff --git a/harbour/examples/hbqt_tut/win03.prg b/harbour/examples/hbqt_tut/win03.prg index c6b47a7087..4356b92288 100644 --- a/harbour/examples/hbqt_tut/win03.prg +++ b/harbour/examples/hbqt_tut/win03.prg @@ -1,20 +1,23 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd -STATIC pulsante1 - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL pulsante1 + s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) - oWnd:resize( 640, 480 ) + oWnd:resize( 400, 300 ) + Pulsante1 := QPushButton( oWnd ) Pulsante1:setText( "Premi per messaggio" ) Pulsante1:resize( 300, 50 ) Pulsante1:move( 50, 50 ) Pulsante1:Connect( "clicked()", { || messaggio() } ) + oWnd:show() s_qApp:exec() @@ -22,11 +25,11 @@ PROCEDURE Main() PROCEDURE messaggio - STATIC oBox + LOCAL oBox oBox := QMessageBox() oBox:setInformativeText( "attenzione!!! " ) oBox:setWindowTitle( "Informazione" ) - oBox:show() + oBox:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win04.prg b/harbour/examples/hbqt_tut/win04.prg index 97b4ff5da8..abe00b225c 100644 --- a/harbour/examples/hbqt_tut/win04.prg +++ b/harbour/examples/hbqt_tut/win04.prg @@ -1,26 +1,29 @@ #include "hbqtgui.ch" - -STATIC s_qApp STATIC oWnd PROCEDURE Main() + LOCAL s_qApp LOCAL Pulsante1, Pulsante2 s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Prova dei pulsanti" ) oWnd:resize( 640, 480 ) + Pulsante1 := QPushButton( oWnd ) Pulsante1:setText( "Quit" ) Pulsante1:move( 50, 50 ) Pulsante1:Connect( "clicked()", { || s_qApp:quit() } ) + Pulsante2 := QPushButton( oWnd ) Pulsante2:setText( "Premere per modificare la barra del titolo" ) Pulsante2:move( 50, 100 ) Pulsante2:setIcon( QIcon( "Star_32.bmp" ) ) Pulsante2:resize( 300, 50 ) Pulsante2:Connect( "clicked()", { || modifica() } ) + oWnd:show() s_qApp:exec() @@ -28,6 +31,6 @@ PROCEDURE Main() PROCEDURE modifica() - oWnd:setWindowTitle( "Evviva, ci sono riuscito !!!!!!!!!!!!!" ) + oWnd:setWindowTitle( "Evviva, ci sono riuscito !!!!!!!!!" ) RETURN diff --git a/harbour/examples/hbqt_tut/win05.prg b/harbour/examples/hbqt_tut/win05.prg index a64d32992b..1f273c2770 100644 --- a/harbour/examples/hbqt_tut/win05.prg +++ b/harbour/examples/hbqt_tut/win05.prg @@ -1,20 +1,24 @@ #include "hbqtgui.ch" -STATIC s_qApp - PROCEDURE Main() + LOCAL s_qApp LOCAL oWnd LOCAL oSBar s_qApp := QApplication() + oWnd := QMainWindow() oWnd:show() - oWnd:setWindowTitle( "Harbour-Qt Implementation Test Dialog" ) - oWnd:resize( 640, 480 ) + + oWnd:setWindowTitle( "Giovanni" ) + oWnd:resize( 300, 200 ) + oSBar := QStatusBar( oWnd ) oWnd:setStatusBar( oSBar ) + oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win06.prg b/harbour/examples/hbqt_tut/win06.prg index 001508f2ec..4661e61b83 100644 --- a/harbour/examples/hbqt_tut/win06.prg +++ b/harbour/examples/hbqt_tut/win06.prg @@ -1,27 +1,30 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd -STATIC barra_schede -STATIC clienti, fornitori, magazzino - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL barra_schede + LOCAL clienti, fornitori, magazzino + s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) oWnd:resize( 500, 300 ) + barra_schede := QTabWidget( oWnd ) barra_schede:resize( 400, 200 ) barra_schede:move( 50, 50 ) - clienti := QWidget() + clienti := QWidget() fornitori := QWidget() magazzino := QWidget() barra_schede:addTab( clienti, "Scheda Clienti" ) barra_schede:addTab( fornitori, "Scheda Fornitori" ) barra_schede:addTab( magazzino, "Scheda Magazzino" ) + oWnd:show() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win07.prg b/harbour/examples/hbqt_tut/win07.prg index e85fdf75a0..0d73d8e0d6 100644 --- a/harbour/examples/hbqt_tut/win07.prg +++ b/harbour/examples/hbqt_tut/win07.prg @@ -1,19 +1,21 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC oWnd STATIC testo -STATIC orolo PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL orolo + s_qApp := QApplication() oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) - oWnd:resize( 640, 480 ) + oWnd:resize( 250, 150 ) + testo := Qlabel( oWnd ) testo:setText( "clocking..." ) testo:move( 100, 100 ) + orolo := QTimer() orolo:Connect( "timeout()", { || stampa_orologio() } ) orolo:start( 1000 ) diff --git a/harbour/examples/hbqt_tut/win08.prg b/harbour/examples/hbqt_tut/win08.prg index 024ec1f70b..a65323b2d1 100644 --- a/harbour/examples/hbqt_tut/win08.prg +++ b/harbour/examples/hbqt_tut/win08.prg @@ -1,29 +1,29 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC oWnd STATIC testo STATIC orolo -STATIC pulsante_start, pulsante_stop PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL pulsante_start, pulsante_stop + s_qApp := QApplication() oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) - oWnd:resize( 640, 480 ) + oWnd:resize( 300, 200 ) testo := Qlabel( oWnd ) testo:setText( "clocking..." ) - testo:move( 100, 100 ) + testo:move( 50, 50 ) testo:resize( 200, 100 ) orolo := QTimer() orolo:Connect( "timeout()", { || stampa_orologio() } ) pulsante_start := QPushButton( oWnd ) - pulsante_start:move( 300, 100 ) + pulsante_start:move( 150, 50 ) pulsante_start:setText( "Start" ) pulsante_start:connect( "pressed()", { || start() } ) pulsante_stop := QPushButton( oWnd ) - pulsante_stop:move( 300, 200 ) + pulsante_stop:move( 150, 100 ) pulsante_stop:setText( "Stop" ) pulsante_stop:connect( "pressed()", { || stop() } ) oWnd:show() diff --git a/harbour/examples/hbqt_tut/win09.prg b/harbour/examples/hbqt_tut/win09.prg index a0a884d23a..966b27e501 100644 --- a/harbour/examples/hbqt_tut/win09.prg +++ b/harbour/examples/hbqt_tut/win09.prg @@ -1,21 +1,23 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd - PROCEDURE Main() + LOCA s_qApp + LOCAL oWnd LOCAL Pulsante1 s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Prova dei pulsanti" ) oWnd:resize( 300, 200 ) + Pulsante1 := QPushButton( oWnd ) Pulsante1:setText( "Quit" ) Pulsante1:move( 50, 50 ) Pulsante1:Connect( "clicked()", { || s_qApp:quit() } ) - Pulsante1:setStyleSheet( "background-color: yellow; border: 2px solid #FF0000;" ) + Pulsante1:setStyleSheet( "background-color: yellow; border: 2px solid # FF0000;") + oWnd:show() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win10.prg b/harbour/examples/hbqt_tut/win10.prg index f8ce8b1971..2642ab44cb 100644 --- a/harbour/examples/hbqt_tut/win10.prg +++ b/harbour/examples/hbqt_tut/win10.prg @@ -2,29 +2,36 @@ PROCEDURE Main() - STATIC qApp - STATIC finestra - STATIC oMenuBar, oMenu1, oVoceIns, oVoceMod + LOCAL qApp + LOCAL finestra + LOCAL oMenuBar, oMenu1, oVoceIns, oVoceMod qApp := QApplication() + // ----------Impostazione Finestra----------- finestra := QmainWindow() finestra:SetFixedSize( 300, 200 ) finestra:setWindowTitle( "Volto" ) + // ----------Impostazione Menu----------- oMenuBar := QMenuBar( finestra ) oMenuBar:resize( 700, 22 ) + oMenu1 := QMenu() oMenu1:setTitle( "Anagrafica" ) + oVoceIns := QAction( oMenu1 ) oVoceIns:setText( "Inserimento" ) oVoceIns:connect( "triggered(bool)", { || inserimento() } ) oVoceMod := QAction( oMenu1 ) oVoceMod:setText( "Modifica" ) oVoceMod:connect( "triggered(bool)", { || modifica() } ) + oMenu1:addAction( oVoceIns ) oMenu1:addAction( oVoceMod ) + oMenuBar:addMenu( oMenu1 ) + finestra:Show() qApp:exec() diff --git a/harbour/examples/hbqt_tut/win11.prg b/harbour/examples/hbqt_tut/win11.prg index 82ebc29818..1f75a8322e 100644 --- a/harbour/examples/hbqt_tut/win11.prg +++ b/harbour/examples/hbqt_tut/win11.prg @@ -1,16 +1,18 @@ #include "hbqtgui.ch" -STATIC applicazione, finestra, ui, file - PROCEDURE Main() + LOCAL applicazione, finestra, ui, file + applicazione := QApplication() file := QFile( "prova.ui" ) file:open( 1 ) ui := QUiLoader() + finestra := ui:load( file ) file:close() finestra:show() + applicazione:exec() applicazione:quit() diff --git a/harbour/examples/hbqt_tut/win12.prg b/harbour/examples/hbqt_tut/win12.prg index a5a559e888..f58e0a5f21 100644 --- a/harbour/examples/hbqt_tut/win12.prg +++ b/harbour/examples/hbqt_tut/win12.prg @@ -1,5 +1,4 @@ #include "hbqtgui.ch" - STATIC tabella PROCEDURE Main() diff --git a/harbour/examples/hbqt_tut/win13.prg b/harbour/examples/hbqt_tut/win13.prg index e0541f2fcc..613dc025a2 100644 --- a/harbour/examples/hbqt_tut/win13.prg +++ b/harbour/examples/hbqt_tut/win13.prg @@ -1,20 +1,23 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd -STATIC stringa -STATIC dialogo - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL stringa + LOCAL dialogo + s_qApp := QApplication() oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) oWnd:resize( 400, 300 ) + oWnd:show() + dialogo := QInputDialog() stringa = dialogo:getText( oWnd, "Titolo", "Come ti chiami?" ) oWnd:setWindowTitle( stringa ) + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win14.prg b/harbour/examples/hbqt_tut/win14.prg index 8d7f0dcee6..c661bd857a 100644 --- a/harbour/examples/hbqt_tut/win14.prg +++ b/harbour/examples/hbqt_tut/win14.prg @@ -1,13 +1,13 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC barra_progresso - PROCEDURE Main() + LOCAL s_qApp + LOCAL barra_progresso LOCAL k s_qApp := QApplication() + barra_progresso := QProgressBar() barra_progresso:resize( 400, 50 ) barra_progresso:move( 50, 50 ) @@ -15,9 +15,11 @@ PROCEDURE Main() barra_progresso:setWindowTitle( "Elaborazione in corso" ) barra_progresso:Show() barra_progresso:repaint() + for k = 1 TO 500000 barra_progresso:setValue( k ) next k + barra_progresso:quit() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win15.prg b/harbour/examples/hbqt_tut/win15.prg index 61c67f67d7..0a62fdec0a 100644 --- a/harbour/examples/hbqt_tut/win15.prg +++ b/harbour/examples/hbqt_tut/win15.prg @@ -1,21 +1,25 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC finestra -STATIC logo - PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL logo + s_qApp := QApplication() + finestra := QmainWindow() finestra:SetFixedSize( 400, 300 ) finestra:setWindowTitle( "Finestra Giovanni" ) + logo := QLabel( finestra ) logo:move( 50, 50 ) logo:resize( 300, 200 ) logo:SetPixmap( QPixmap( "test.jpg" ) ) logo:setStyleSheet( "border: 2px solid #0000ff;" ) + finestra:show() + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win16.prg b/harbour/examples/hbqt_tut/win16.prg index c20e380536..7ae6151661 100644 --- a/harbour/examples/hbqt_tut/win16.prg +++ b/harbour/examples/hbqt_tut/win16.prg @@ -1,19 +1,22 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC oWnd -STATIC testo - PROCEDURE Main() + LOCAL s_qApp + LOCAL oWnd + LOCAL testo + s_qApp := QApplication() + oWnd := QMainWindow() oWnd:setWindowTitle( "Finestra di Giovanni" ) oWnd:resize( 300, 200 ) + testo := Qlabel( oWnd ) testo:setText( "Gio" ) testo:move( 10, 10 ) testo:resize( 280, 100 ) + oWnd:show() s_qApp:exec() diff --git a/harbour/examples/hbqt_tut/win17.prg b/harbour/examples/hbqt_tut/win17.prg index ebca702117..20889b2b48 100644 --- a/harbour/examples/hbqt_tut/win17.prg +++ b/harbour/examples/hbqt_tut/win17.prg @@ -1,26 +1,30 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC finestra -STATIC font -STATIC testo STATIC palette STATIC slider_rosso, slider_verde, slider_blu +STATIC testo PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL font + s_qApp := QApplication() + finestra := QMainWindow() finestra:resize( 320, 400 ) finestra:setWindowTitle( "Giovanni" ) + font := QFont() font:setPointSize( 30 ) font:setBold( .T. ) + testo := QLabel( finestra ) testo:setText( "Colori" ) testo:move( 100, 10 ) testo:resize( 200, 100 ) testo:setfont( font ) + slider_rosso := QSlider( finestra ) slider_rosso:resize( 30, 200 ) slider_rosso:move( 100, 120 ) @@ -30,6 +34,7 @@ PROCEDURE Main() slider_rosso:setPageStep( 10 ) slider_rosso:setValue( 0 ) slider_rosso:Connect( "valueChanged(int)", { || cambia_colori() } ) + slider_verde := QSlider( finestra ) slider_verde:resize( 30, 200 ) slider_verde:move( 150, 120 ) @@ -39,6 +44,7 @@ PROCEDURE Main() slider_verde:setPageStep( 10 ) slider_verde:setValue( 0 ) slider_verde:Connect( "valueChanged(int)", { || cambia_colori() } ) + slider_blu := QSlider( finestra ) slider_blu:resize( 30, 200 ) slider_blu:move( 200, 120 ) @@ -48,7 +54,9 @@ PROCEDURE Main() slider_blu:setPageStep( 10 ) slider_blu:setValue( 0 ) slider_blu:Connect( "valueChanged(int)", { || cambia_colori() } ) + finestra:show() + s_qApp:exec() RETURN @@ -60,4 +68,3 @@ PROCEDURE cambia_colori() testo:setPalette( palette ) RETURN - diff --git a/harbour/examples/hbqt_tut/win18.prg b/harbour/examples/hbqt_tut/win18.prg index 0cb65d066e..5cedbfb935 100644 --- a/harbour/examples/hbqt_tut/win18.prg +++ b/harbour/examples/hbqt_tut/win18.prg @@ -1,17 +1,19 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC finestra STATIC font STATIC testo STATIC modificatore PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + s_qApp := QApplication() + finestra := QMainWindow() finestra:resize( 320, 200 ) finestra:setWindowTitle( "Giovanni" ) + font := QFont() font:setPointSize( 30 ) testo := QLabel( finestra ) @@ -19,6 +21,7 @@ PROCEDURE Main() testo:move( 10, 10 ) testo:resize( 280, 100 ) testo:setfont( font ) + modificatore := QSpinBox( finestra ) modificatore:move( 50, 150 ) modificatore:resize( 50, 25 ) @@ -27,7 +30,9 @@ PROCEDURE Main() modificatore:setMaximum( 72 ) modificatore:setSingleStep( 1 ) modificatore:setValue( 30 ) + finestra:show() + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win19.prg b/harbour/examples/hbqt_tut/win19.prg index 8432c28f5b..82e7274b8b 100644 --- a/harbour/examples/hbqt_tut/win19.prg +++ b/harbour/examples/hbqt_tut/win19.prg @@ -1,15 +1,17 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC finestra -STATIC casella - PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL casella + s_qApp := QApplication() + finestra := QMainWindow() finestra:resize( 320, 200 ) finestra:setWindowTitle( "Giovanni" ) + casella := QComboBox( finestra ) casella:move( 100, 50 ) casella:resize( 100, 25 ) @@ -21,7 +23,9 @@ PROCEDURE Main() casella:addItem( "Spagna" ) casella:addItem( "Portogallo" ) casella:addItem( "Islanda" ) + finestra:show() + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win20.prg b/harbour/examples/hbqt_tut/win20.prg index 5af3a0bab4..12368d4631 100644 --- a/harbour/examples/hbqt_tut/win20.prg +++ b/harbour/examples/hbqt_tut/win20.prg @@ -1,26 +1,34 @@ -STATIC s_qApp -STATIC finestra +#include "hbqtgui.ch" STATIC testo -STATIC font STATIC casella PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL font + s_qApp := QApplication() + finestra := QMainWindow() finestra:resize( 320, 200 ) finestra:setWindowTitle( "Giovanni" ) + font := QFont() + testo := Qlabel( finestra ) testo:setText( "Ciao a tutti" ) testo:resize( 200, 80 ) testo:move( 50, 20 ) testo:setfont( font ) + casella := QFontComboBox( finestra ) casella:move( 50, 100 ) casella:resize( 200, 25 ) casella:Connect( "currentFontChanged(QFont)", { || cambia_testo() } ) + finestra:show() + s_qApp:exec() RETURN diff --git a/harbour/examples/hbqt_tut/win21.prg b/harbour/examples/hbqt_tut/win21.prg index 0821380d66..ad45c8e569 100644 --- a/harbour/examples/hbqt_tut/win21.prg +++ b/harbour/examples/hbqt_tut/win21.prg @@ -1,12 +1,10 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC finestra STATIC lcd -STATIC pulsante_diminuisci, pulsante_aumenta PROCEDURE Main() + LOCAL s_qApp, finestra, pulsante_diminuisci, pulsante_aumenta + s_qApp := QApplication() finestra := QMainWindow() finestra:resize( 300, 200 ) @@ -34,7 +32,7 @@ PROCEDURE incrementa() LOCAL x x := lcd:value() - x++ + x ++ lcd:display( x ) RETURN @@ -44,7 +42,7 @@ PROCEDURE decrementa() LOCAL x x := lcd:value() - x-- + x -- lcd:display( x ) RETURN diff --git a/harbour/examples/hbqt_tut/win22.prg b/harbour/examples/hbqt_tut/win22.prg index 09f6e6798d..c87e5c93ad 100644 --- a/harbour/examples/hbqt_tut/win22.prg +++ b/harbour/examples/hbqt_tut/win22.prg @@ -1,43 +1,51 @@ #include "hbqtgui.ch" - -STATIC s_qApp -STATIC finestra -STATIC testo STATIC edit1, edit2, edit3 -STATIC calcola PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL testo + LOCAL calcola + SET DATE ITALIAN s_qApp := QApplication() + finestra := QMainWindow() finestra:resize( 400, 300 ) finestra:setWindowTitle( "Giovanni" ) + testo := QLabel( finestra ) testo:setText( "Difference between two dates" ) testo:move( 130, 20 ) testo:resize( 171, 16 ) + edit1 := QLineEdit( finestra ) edit1:resize( 113, 20 ) edit1:move( 140, 100 ) + edit2 := QLineEdit( finestra ) edit2:resize( 113, 20 ) edit2:move( 140, 130 ) edit3 := QLineEdit( finestra ) edit3:resize( 113, 20 ) edit3:move( 140, 180 ) + calcola := QPushButton( finestra ) calcola:resize( 75, 23 ) calcola:move( 270, 180 ) calcola:setText( "Calculate" ) calcola:Connect( "clicked()", { || calcola() } ) + finestra:show() + s_qApp:exec() RETURN PROCEDURE calcola() + LOCAL differenza differenza = Abs( CToD( edit1:text() ) - CToD( edit2:text() ) ) diff --git a/harbour/examples/hbqt_tut/win23.prg b/harbour/examples/hbqt_tut/win23.prg index f79329e582..0868caacf0 100644 --- a/harbour/examples/hbqt_tut/win23.prg +++ b/harbour/examples/hbqt_tut/win23.prg @@ -1,11 +1,11 @@ #include "hbqtgui.ch" -STATIC s_qApp -STATIC finestra -STATIC bottone1, bottone2, bottone3 - PROCEDURE Main() + LOCAL s_qApp + LOCAL finestra + LOCAL bottone1, bottone2, bottone3 + s_qApp := QApplication() finestra := QMainWindow() @@ -28,18 +28,17 @@ PROCEDURE Main() bottone3:Connect( "clicked()", { || messaggio( "NON SO" ) } ) finestra:show() - s_qApp:exec() RETURN PROCEDURE messaggio( msg ) - STATIC oBox + LOCAL oBox oBox := QMessageBox() oBox:setInformativeText( msg ) oBox:setWindowTitle( "Informazione" ) - oBox:show() + oBox:exec() RETURN