Results 1 to 9 of 9

Thread: QSqlTableModel, QTableView and complex queries

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    Austria (Europe)
    Posts
    31
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlTableModel, QTableView and complex queries

    Some infos as requested:

    I've finalized my own QSqlQuery subclass but in a way that is very specific to my needs. What I have:

    3 Classes for a database repository that knows what the tables, fields and primary keys should be. Why? First, the database may be in a state that is corrupt. Second, the repository knows much more than the few infos that the database is able to give me.

    My own query class derived from QSqlQuery. The class is able to generate SQL statements fro select, insert, update, delete. The select part is able to generate correct joins. Currently I work on support for outer joins on all supported databases.

    My own delegates can access the repository and in a table view draw the columns in an application specific way.

  2. #2
    Join Date
    Sep 2009
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSqlTableModel, QTableView and complex queries

    Walter,
    You couldn't be more right about this...
    The implementation of QSql***model classes are sufficient only for basic use of databases from my expirience.

    I wonder if people from Nokia plan to do something about it in future releases. It is not that hard to figure out what is needed if you have ANY experience (apart from very basic examples provided) in database programming. I'm also new to Qt (expirienced developer but not in Qt) and I was very disapointed by the implementaton.

    Otherwise, we will have to follow your approach - make our own classes...

  3. #3
    Join Date
    Dec 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSqlTableModel, QTableView and complex queries

    Have you tried QSqlQueryModel instead of QSqlTabelModel?

Tags for this Thread

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.