Results 1 to 2 of 2

Thread: Editable and cached QSqlQueryModel

  1. #1
    Join Date
    May 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Editable and cached QSqlQueryModel

    Did anybody make editable and cached QSqlQueryModel. I know which way I should go and made something. I use data, setData and other methods in subclassing model. But on every step I get surprises, ex. inserted row become checkable after editing. I know that sources of QsqlTableModel will be useful, but they are too complicated. Has anybody more compact ready solution?
    Thanks in advance!

  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: Editable and cached QSqlQueryModel

    QSqlQueryModel is by definition read-only. If you want a model that you can modify then either use QSqlTableModel (perhaps with triggers on the dbms side to distribute the data into proper tables) or implement a custom model that fetches data using an sql query and then submits it using a different sql query.
    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.


Similar Threads

  1. Replies: 1
    Last Post: 19th January 2014, 23:29
  2. Multi-table editable QSqlQueryModel
    By i92guboj in forum Qt Programming
    Replies: 2
    Last Post: 20th August 2013, 12:04
  3. Did image loaded by stylesheets are 'cached'
    By Rholk in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 10th May 2010, 15:48
  4. Implementing cached rendering of a widget.
    By emmanuel in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2010, 20:37
  5. Editable QTreeView
    By winston2020 in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2009, 13:18

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.