Results 1 to 3 of 3

Thread: QTableView::setItemDelegateForColumn on blob columns. Also, how to show failed query?

  1. #1
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default QTableView::setItemDelegateForColumn on blob columns. Also, how to show failed query?

    I want to call setItemDelegateForColumn() for a QTableView for each column that is of type blob. However, I can't figure out how to get the column types from QSqlQueryModel.

    Also, if an invalid query is entered for QSqlQueryModel::setQuery(), the QTableView is blank. However, I would like it to show the error message returned by the database. I can't figure out how to get the error message from QSqlQueryModel.

    Thanks for any help!

  2. #2
    Join Date
    Feb 2008
    Posts
    98
    Thanks
    2
    Thanked 24 Times in 24 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView::setItemDelegateForColumn on blob columns. Also, how to show failed qu

    You will need to subclass QSqlQueryModel.

  3. #3
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: QTableView::setItemDelegateForColumn on blob columns. Also, how to show failed qu

    You can call QSqlError error = newModel->lastError();

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.