EnglishHi, I'm starting to use the fivetouch with examples found here in the forum ,
I would like to know how do I read the value of a cell in the selected row of a
QtableView ? msginfo(oBrw:setCurrentCell(oBrw:rowCount()-1,0):value) //
I would love to returnThanks a lot
ItalianoSalve, sto iniziando ad utilizzare la fivetouch con esempi trovati qui nel forum,
vorrei sapere come faccio a leggere il valore di una cella della riga selezionata di una
QtableView? msginfo(oBrw:setCurrentCell(oBrw:rowCount()-1,0):value) // mi piacerebbe ritornasse kinder barrette
Grazie mille
// ------------------------ ELENCO
FUNCTION Elenco( fDbf, fNtx )
local oDlg := QDialog()
local oBrw :=
QTableView( oDlg )local oModel := QStandardItemModel( 3, 4, oDlg )
LOCAL nNumRecord := 0, i, oIcon
LOCAL oBtnEnd, oBtnTp, oBtnBt,obtninfo
* --- Dichiaro Button
@ 335, 25 BUTTON oBtnEnd PROMPT "Abbandona" OF oDlg ;
ACTION oDlg:End()
@ 335, 150 BUTTON oBtnTp PROMPT "Inizio" OF oDlg ;
ACTION Inizio( oBrw )
@ 335, 250 BUTTON oBtnBt PROMPT "Fine" OF oDlg ;
ACTION Fine( oBrw )
@ 335, 370 BUTTON oBtnBtInfo PROMPT "info" OF oDlg ;
ACTION msginfo(oBrw:setCurrentCell(oBrw:rowCount()-1,0)) // * Mi da errore Me error
*oBrw:setCurrentCell(oBrw:rowCount()-1,0)
* --- Imposto Icone nei Pulsanti
*oBtnEnd:SetIcon( QIcon(xPath + "Exit.png") )
*OBtnEnd:setIconSize(QSize(10,10))
oBtnTp:SetIcon( QIcon(xPath + "go-top.png") )
*OBtnTp:setIconSize(QSize(65,65))
oBtnBt:SetIcon( QIcon(xPath + "go-bottom.png") )
*OBtnBt:setIconSize(QSize(65,65))
* --- Apro File
USE( fDbf ) INDEX ( fNtx ) ALIAS Dati NEW
nNumRecord := Dati->( RecCount() )
* --- Imposto Intestazione
oModel:SetHorizontalHeaderItem( 0, QStandardItem( "Codice" ) )
oModel:SetHorizontalHeaderItem( 1, QStandardItem( "Descrizione" ) )
oModel:SetHorizontalHeaderItem( 2, QStandardItem( "Q.t?" ) )
oModel:SetHorizontalHeaderItem( 3, QStandardItem( "Prezzo" ) )
* --- Carico Dati
For i = 0 TO nNumRecord
oModel:SetItem( i, 0, QStandardItem( Dati->CODICE ) ) // 001
oModel:SetItem( i, 1, QStandardItem( Dati->DESC ) ) // kinder barrette
oModel:SetItem( i, 2, QStandardItem( STR(Dati->QTA) ) ) // 3
oModel:SetItem( i, 3, QStandardItem( STR(Dati->PRE) ) ) //1.40
Dati->( DBSKIP() )
NEXT
* --- Chiudo File
Dati->( DBCLOSEAREA() )
* --- Imposto Form Principale
oDlg:SetWindowTitle( "Elenco" )
oDlg:Resize( 450, 370 )
oDlg:Center()
* --- Imposto Form Browse
oBrw:SetModel( oModel )
oBrw:Resize( 445, 330 )
* --- Imposto Larghezza Colonne della Browse
oBrw:setColumnWidth(0, 90)
oBrw:setColumnWidth(1, 190)
oBrw:setColumnWidth(2, 40)
oBrw:setColumnWidth(3, 50)
* --- Esecuzione
oBrw:show()
oDlg:Exec()
RETURN NIL