Results 1 to 7 of 7

Thread: syntax error : identifier 'QSqlRelationalDelegate'

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Location
    Canada
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy syntax error : identifier 'QSqlRelationalDelegate'

    Hi,

    For some reason, i cannot access the QSqlRelationalDelegate method, either in my code or with the sample code.

    For example this code from the sample:

    Qt Code:
    1. QTableView *view = new QTableView;
    2. view->setModel(model);
    3. view->setItemDelegate(new QSqlRelationalDelegate(view));
    To copy to clipboard, switch view to plain text mode 

    i get a syntax error : identifier 'QSqlRelationalDelegate' error when compliing with VS2005.

    Or with:
    Qt Code:
    1. model = new QSqlRelationalTableModel(this, m_pPrimarydb);
    2.  
    3. model->setTable(tableName);
    4. model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    5. model->setRelation(18, QSqlRelation("Category", "mCategoryID", "mCategoryName"));
    6.  
    7. model->select();
    8.  
    9. m_pMusicTableView->setModel(model);
    10.  
    11. m_pMusicTableView->setItemDelegate(new QSqlRelationalDelegate(m_pMusicTableView));
    12.  
    13. m_pMusicTableView->show();
    To copy to clipboard, switch view to plain text mode 


    All other sql functions seem to be working with no problem. (qsqldatabase, qsqlquery.. etc)

    I have no clue what I have forgotten to include to get this to compile, any help appreciated.

    Thanks,
    Johnny
    Last edited by sticcino; 1st July 2008 at 22:55. Reason: added addtional explaination

Similar Threads

  1. StyleSheet syntax checking
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 30th June 2008, 10:09
  2. lib("dnsapi")
    By CHeader in forum Newbie
    Replies: 10
    Last Post: 16th February 2008, 19:21
  3. Refreshing syntax highlighting
    By jpn in forum Qt Programming
    Replies: 3
    Last Post: 26th July 2006, 20:09
  4. #ifndef syntax error
    By cbeall1 in forum Qt Programming
    Replies: 6
    Last Post: 14th February 2006, 09:29
  5. A Qt4 editor part with syntax highlighting and stuff?
    By mgoettsche in forum General Discussion
    Replies: 3
    Last Post: 22nd January 2006, 16:32

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.