Results 1 to 4 of 4

Thread: QSqlTableModel/ QTableView parsing queries to xml

  1. #1
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlTableModel/ QTableView parsing queries to xml

    Hello,

    This is my first post to this forum and I hope the problem I am asking for solution is explained clearly . I am using QSqlTableModel and QSqlTableView for viewing a table of the DB. The cached table model is what I was looking for, that's why I chose QSqlTableModel(are there any other models?). Now I need to parse to xml all the queries cached, once I do submitAll() - I have chosen OnManualSubmit as edit strategy. I tried to write a subclass of QSqlTableModel and overload insertRowInTable/updateRowInTable/deleteRowFromTable, but the cache is accessed by a d-pointer to a private class and I don't find another way to get the cached prepared statements for then parsing them to xml. Is this solution I have thought not possible?

    I am looking forward to any replies.

  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: QSqlTableModel/ QTableView parsing queries to xml

    Do you wish to serialize queries or their results?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlTableModel/ QTableView parsing queries to xml

    I should send the queries to a server in xml format and not directly to the DB. The serialization of the results is handled by the server.

  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: QSqlTableModel/ QTableView parsing queries to xml

    Quote Originally Posted by lizi_85 View Post
    I should send the queries to a server in xml format and not directly to the DB. The serialization of the results is handled by the server.
    So essentially you need to implement your own SQL driver plugin. See the QSqlDriver and QSqlDriverPlugin classes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    lizi_85 (4th December 2012)

Similar Threads

  1. Replies: 9
    Last Post: 19th November 2009, 09:18
  2. QSqlTableModel, QTableView and complex queries
    By Walter in forum Qt Programming
    Replies: 8
    Last Post: 15th November 2009, 01:20
  3. QTableView queries
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2009, 09:13
  4. QTableView and QSqlTableModel problem
    By Misenko in forum Qt Programming
    Replies: 5
    Last Post: 19th August 2008, 21:58
  5. QTableView and QSQLTableModel
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2006, 18:09

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.