Results 1 to 5 of 5

Thread: QTableView

  1. #1
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTableView

    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 ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView

    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?

  3. #3
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView

    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.

  5. #5
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView

    Thank you Wysota

Similar Threads

  1. Set height of QTableView to fit exact number of rows.
    By Ben.Hines in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2019, 01:49
  2. QTableView sorting
    By gabriels in forum Qt Programming
    Replies: 11
    Last Post: 6th October 2010, 17:13
  3. QTableView currentChanged <> selecting header
    By Everall in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2009, 08:24
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.