Results 1 to 8 of 8

Thread: Illegal instruction (Signal SIGILL) for QSqlQuery

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Illegal instruction (Signal SIGILL) for QSqlQuery

    Hi

    I have a simple SQL insertion and select statements as shown in the code below.
    Qt Code:
    1. QString name_1, number_1;
    2. QSqlQuery query(iLbsDb);
    3. query.prepare("insert into contacttable (name, number) values(?,?)");
    4. query.bindValue(":name", name);
    5. query.bindValue(":number", number);
    6.  
    7. if(query.exec())
    8. {
    9. QSqlQuery query_1(iLbsDb);
    10. query_1.prepare("select * from contacttable");
    11.  
    12. if(query_1.exec())
    13. {
    14. while(query_1.next())
    15. {
    16. QSqlRecord rec = query_1.record();
    17. int c;
    18. if(rec.isEmpty() != true)
    19. c = rec.indexOf("number");
    20. if(query_1.isValid())
    21. name_1 = query_1.value( c).toString();
    22. //number_1 = query_1.value(1).toString();
    23. qDebug("name %s", name_1);
    24. //qDebug("number %s", number_1);
    25. }
    26. }
    27. return true;
    28. }
    29. else
    30. return false;
    To copy to clipboard, switch view to plain text mode 
    Im receiving the error
    sStopped: Illegal instruction (Signal SIGILL).
    at the instruction
    Qt Code:
    1. name_1 = query_1.value( c).toString();
    To copy to clipboard, switch view to plain text mode 
    Unable to figure out what might be the problem.

    I tried
    Qt Code:
    1. QVariant t = query_1.value(c);
    2. QString s = t.toString();
    To copy to clipboard, switch view to plain text mode 

    The variable t seem to have been populated, but the error occurs in the toString line

    Pls help

    Thanks
    Last edited by wysota; 19th August 2011 at 14:26. Reason: changed [quote] to [code]

Similar Threads

  1. Replies: 1
    Last Post: 18th July 2011, 12:12
  2. QWizard produces SIGILL
    By lauwe in forum Qt Programming
    Replies: 3
    Last Post: 6th March 2011, 19:46
  3. Replies: 1
    Last Post: 1st April 2010, 07:54
  4. XML processing instruction
    By mattia in forum Newbie
    Replies: 1
    Last Post: 26th February 2008, 11:37

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.