Results 1 to 2 of 2

Thread: problem with qsqltablemodel

  1. #1
    Join Date
    Oct 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem with qsqltablemodel

    when tru to run, give this error: C2664: 'QSqlTableModel::QSqlTableModel(QSqlTableModelPriv ate &,QObject *,QSqlDatabase)' : cannot convert parameter 1 from 'QSqlTableModel *' to 'QSqlTableModelPrivate &'
    Qt Code:
    1. model->setHeaderData(0,Qt::Horizontal,"name");
    2. model->setHeaderData(1,Qt::Horizontal,"Date");
    3. model->setHeaderData(2,Qt::Horizontal,"id");
    4. model->setTable( "workmoneydata" );
    5. model->setFilter( QString("name= %s").arg(name) );
    6. model->select();
    7.  
    8. return model;
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: problem with qsqltablemodel

    The function's signature is:
    Qt Code:
    1. QSqlTableModel getwmData(QString name);
    To copy to clipboard, switch view to plain text mode 
    And you're returning a pointer (QSqlTableModel *).

Similar Threads

  1. QSqlTableModel Master/Detail example problem
    By MementoMori in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2011, 15:54
  2. Replies: 8
    Last Post: 30th March 2011, 21:06
  3. QSqlTableModel problem
    By waynew in forum Newbie
    Replies: 10
    Last Post: 8th January 2010, 01:48
  4. QTableView and QSqlTableModel problem
    By Misenko in forum Qt Programming
    Replies: 5
    Last Post: 19th August 2008, 22:58
  5. QCompleter + QSqlTableModel problem
    By Lykurg in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2007, 21:59

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.