PDA

View Full Version : QTableView



fpujol
12th January 2007, 13:49
Hello,

I'm making an application for a litte supermarket to generate a tickets. The application
need to be fast reading barCode. I'm no sure what is the best way to do it. I stated with
QSqlTableView and QSqlTableModel with edit strategy OnRowChange. My first problem
is that every row that I start how I can tell to the QtableView that put the cursor on a
determinated column and so I can obtain an event it leaves the column to check if ean
is right ? Another question is when all row is full and right data how I can start new row
automatically without the need press ENTER key to validate the row.

Perhaps is best read BarCode in QlineEdit for best control an then put the ean to the
QtableView. I don't now, any experiences ?

wysota
12th January 2007, 15:38
Could you elaborate on the problem? Your description is unclear... Maybe it'd be better if you described what the app needs to achieve in this particular situation?

fpujol
15th January 2007, 13:12
I need control when a user exits in a determinated colum of QTableView to check if data
is correct (bar code) if data is correct I need to automatically create a new row without the need
of press key ENTER to validate the actual row, because the user don't have a keyboard.

Thank you

wysota
15th January 2007, 14:51
I would reimplement the delegate for the table and its setModelData() method. You can do all the checks you want there whenever the editing is finished.

fpujol
16th January 2007, 09:17
Thank you Wysota