Results 1 to 5 of 5

Thread: QSqlTableModel Setting Current Row?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QSqlTableModel Setting Current Row?

    Won't QAbstractItemModel::match() allow you to find the proper index? Anyway, wouldn't it be better if the lookup dialog returned a model index instead of the field value? If you operate on the same set of tables, it would be wise to stick with the model interface everywhere possible.

  2. #2
    Join Date
    Apr 2008
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanked 1 Time in 1 Post

    Default Re: QSqlTableModel Setting Current Row?

    Quote Originally Posted by wysota View Post
    Won't QAbstractItemModel::match() allow you to find the proper index?
    Thanks, I have things working at the moment using functions to find next, prev etc with sql. But I'll have a look into the match method, seems much simpler and exactly what I was looking for.

    Quote Originally Posted by wysota View Post
    Anyway, wouldn't it be better if the lookup dialog returned a model index instead of the field value? If you operate on the same set of tables, it would be wise to stick with the model interface everywhere possible.
    I did consider using the same model across all windows/dialogs. However, I decided against that given an example situation such as;

    1. Main Client List window - user filters the records
    2. Client Detail/Edit window - user creates a new record

    Now, if the new record doesn't fit the filter, then from the users perspective their newly created record 'vanishes'.

Similar Threads

  1. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  2. setting working directory for current process
    By mule in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2007, 13:54
  3. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  4. Replies: 15
    Last Post: 21st April 2007, 17:46
  5. Replies: 1
    Last Post: 19th April 2007, 22:23

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
  •  
Qt is a trademark of The Qt Company.