Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlQueryModel shows empty table with correct headers.
QtWS25 Last Chance

QSqlQueryModel shows empty table with correct headers.

Scheduled Pinned Locked Moved General and Desktop
qt5.4sqlodbcqsqlqueryqsqlquerymodel
1 Posts 1 Posters 963 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Charlie42
    wrote on last edited by Charlie42
    #1

    Code:

    QSqlQueryModel *model = new QSqlQueryModel;
    QSqlQuery query;
    query.exec("{CALL syllabi_output}");
    
    model->setQuery(query);
    ui->tableView_4->setModel(model);
    
    //debug
    query.first();
    qDebug() << query.value(0).toString();
    //debug
    

    Debug shows the correct values though.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved