Results 1 to 8 of 8

Thread: How send result query database to List<QString>

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How send result query database to List<QString>

    I am afraid I don't understand.
    Your code already adds strings to the list, i.e. you already know how the << operator works.

    Cheers,
    _

  2. #2
    Join Date
    Jan 2016
    Posts
    9
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How send result query database to List<QString>

    Something like that?

    list << query.exec("select kod_lekarstwa, nazwa from lekarstwo;");

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How send result query database to List<QString>

    exec() returns a bool.

    You want to loop over the results. See the example in the documentation for QSqlQuery.

    Cheers,
    _

Similar Threads

  1. Filling a ComboBox with SQL query result
    By igr in forum Qt Programming
    Replies: 1
    Last Post: 1st September 2014, 17:16
  2. how to send sqlite query CREATE TRIGGER in qt application
    By abdul_moiz in forum Qt Programming
    Replies: 2
    Last Post: 10th June 2011, 06:07
  3. query regarding installing a database along with App
    By chandantheracer in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd June 2011, 15:27
  4. How to find result of a query in qsqlite?
    By newtowindows in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2009, 11:40
  5. Replies: 1
    Last Post: 19th August 2007, 19:50

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.