Results 1 to 3 of 3

Thread: Query - how to store ?

  1. #1
    Join Date
    Feb 2010
    Posts
    23
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60

    Question Query - how to store ?

    Dear all,

    i am using Qt in Symbian .

    QSqlQuery query;
    query.prepare(QString("select Number,Enable from FilterNumTable where Enable = '1'"));

    it will show like this

    Number Enable
    ------ ------
    12345 1
    12346 1
    12347 1

    how can i store the Number in to < Array or QList >
    how to store?
    any one have idea about this?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Query - how to store ?

    Qt Code:
    1. QList<int> list;
    2. QSqlQuery query("select Number from FilterNumTable where Enable = '1'");
    3. while (query.next())
    4. list << query.value(0).toInt();
    To copy to clipboard, switch view to plain text mode 
    You don't have to get Enable since you know that it is 1. And is Enable really a string?

  3. #3
    Join Date
    Feb 2010
    Posts
    23
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60

    Thumbs up Re: Query - how to store ?

    Quote Originally Posted by Lykurg View Post
    Qt Code:
    1. QList<int> list;
    2. QSqlQuery query("select Number from FilterNumTable where Enable = '1'");
    3. while (query.next())
    4. list << query.value(0).toInt();
    To copy to clipboard, switch view to plain text mode 
    You don't have to get Enable since you know that it is 1. And is Enable really a string?
    thx for u r reply Lykurg

Similar Threads

  1. where can I store pictures for Qtopia emulator
    By learning_qt in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 18th September 2008, 11:13
  2. Store the filename of QIcon
    By Nithya in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2008, 17:54
  3. what is free store in C++ memory?
    By Masih in forum General Programming
    Replies: 6
    Last Post: 2nd July 2007, 23:25
  4. Turn off backing store
    By Rayven in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2007, 19:01
  5. Is it possible to store pointers in a database ?
    By probine in forum General Programming
    Replies: 8
    Last Post: 5th April 2006, 22:28

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.