Results 1 to 14 of 14

Thread: QTableWidget not Displaying multiple rows from SQL Query

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: QTableWidget not Displaying multiple rows from SQL Query

    I understood how the code works, I asked if you have confirmed that those two variables have the expected values after the loop.

    You write that "i" has the value 1, which, if taken after the loop, would mean the loop ran one iteration.

    Cheers,
    _

  2. #2
    Join Date
    Apr 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QTableWidget not Displaying multiple rows from SQL Query

    Indeed it ran 1 iteration and then stopped. Without creating a new row and without printing the new information from the query

  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: QTableWidget not Displaying multiple rows from SQL Query

    Ok, so there is one row in your table as expected or is that row empty?

    Cheers,
    _

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: QTableWidget not Displaying multiple rows from SQL Query

    Can you simply attach the real CPP file to the post?

  5. #5
    Join Date
    Apr 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QTableWidget not Displaying multiple rows from SQL Query

    Ok guys I just figured it out, what I did to solve it was add a "ui->tableWidget->setRowCount(row);" at the end of the loop and actually it worked just fine. Thank you both for your help and time

Similar Threads

  1. Replies: 5
    Last Post: 24th January 2014, 01:22
  2. QSQLITE: multiple instructions in SQL query
    By mcosta in forum Qt Programming
    Replies: 7
    Last Post: 9th March 2011, 22:27
  3. Replies: 4
    Last Post: 6th March 2011, 09:54
  4. QTableWidget - Select multiple rows.
    By wally in forum Qt Programming
    Replies: 2
    Last Post: 21st October 2008, 17:15
  5. QTableWidget Sql Query 25.000 records
    By aekilic in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2008, 14:54

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
  •  
Qt is a trademark of The Qt Company.