Results 1 to 6 of 6

Thread: QTableView connected with QSqlTableModel flickers (scrolls to the bottom and returns)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Posts
    9
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableView connected with QSqlTableModel flickers (scrolls to the bottom and retu

    Thank you for your time, may I didn't study the documentation enough. I will try to re-organise the code and I will update the issue

  2. #2
    Join Date
    Feb 2012
    Posts
    9
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableView connected with QSqlTableModel flickers (scrolls to the bottom and retu

    I changed my code and I remove the sql query exec I tried to modify the data with the setData but unfortunately nothing happened


    Qt Code:
    1. bool AttributesModel::setData(const QModelIndex &index, const QVariant &value, int role)
    2. {
    3. if(index.column() == STATUS_INDEX) {
    4. bool ret = QSqlTableModel::setData(index, value == Qt::Checked ? Qt::Unchecked : Qt::Checked, role);
    5. database().commit();
    6. this->submitAll();
    7. return ret;
    8. }
    9. return QSqlTableModel::setData(index, value, role);
    10. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QSqlTableModel::removeRows returns false
    By caster89 in forum Qt Programming
    Replies: 5
    Last Post: 25th June 2021, 13:55
  2. Replies: 11
    Last Post: 8th May 2015, 23:30
  3. QAbstractItemView flickers
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 2nd June 2008, 21:01
  4. Replies: 7
    Last Post: 15th November 2007, 17:19
  5. QTableView and QSQLTableModel
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2006, 18:09

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.