Results 1 to 9 of 9

Thread: Does 'QSqlQueryModel' have a bug?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Location
    Bangkok, THAILAND
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation Does 'QSqlQueryModel' have a bug?

    Hello. Now I have a problem when using QSqlQueryModel or QSqlTableModel. I installed an open-source version of Qt 4.6.2 for VS2008 and Qt 1.4.4 add-in for VS2008 on WinXP. The VC++ compiler always throw the error message "error C2248: 'QSqlTableModel::setQuery' : cannot access protected member declared in class 'QSqlTableModel'" when I set a parameter in setQuery() function as below:
    Qt Code:
    1.  
    2. // assume that 'stock' is a table.
    3. model->setQuery(tr("SELECT * FROM stock WHERE id = %1").arg(ui.searchComboBox->currentText()));
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1.  
    2. // assume that 'stock' is a table.
    3. model->setQuery("SELECT * FROM stock WHERE id = 1");
    To copy to clipboard, switch view to plain text mode 
    But according to a Qt documentation, it said that user can pass a string into setQuery() function. So is it a bug and what should I do?

    Thanks a lot!
    Last edited by nuntawat; 16th March 2010 at 11:57. Reason: Corrent a version number of Qt

Similar Threads

  1. About QSqlQueryModel
    By vinny gracindo in forum Newbie
    Replies: 1
    Last Post: 11th December 2009, 22:27
  2. QSqlQueryModel tweaks?
    By baray98 in forum Qt Programming
    Replies: 5
    Last Post: 22nd September 2009, 00:58
  3. how can I refresh QSqlQueryModel?
    By hashb in forum Qt Programming
    Replies: 3
    Last Post: 20th June 2009, 03:39
  4. QTableView/QSqlQueryModel
    By norobro in forum Qt Programming
    Replies: 7
    Last Post: 15th February 2008, 21:52
  5. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 08:55

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.