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. [Partial Solve]Can't access QSqlQueryModel database programmatically
Forum Updated to NodeBB v4.3 + New Features

[Partial Solve]Can't access QSqlQueryModel database programmatically

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.3k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    weblife
    wrote on last edited by
    #1

    Why can't I access QSqlQueryModel member functions programmaticaly as described in the "documentation":http://qt-project.org/doc/qt-4.8/qsqlquerymodel.html? What am I not considering?

    I was able to access it when I tested; before I started passing the QSqlQueryModel data between classes. Any advice is welcome. "My failed class code example here":http://qt-project.org/forums/viewthread/19590/.

    I am passing data from the QSqlQueryModel as a widget to a control class that shares it with its widgets. I have passed the model seemingly successful (no error code output) though a pointers because I access some basic members like rowCount().

    @int intTest = model->rowCount();@
    

    What can’t I access the values in the standard fashion:

    @QString stringTest = model->record(i).value("firstName").toString();@
    

    Brandon Clark
    www.themindspot.com

    1 Reply Last reply
    0
    • W Offline
      W Offline
      weblife
      wrote on last edited by
      #2

      Here is the answer I am looking for, or at least partially:
      @
      QString stringTest = model->data(model->index(i,3)).toString();@

      Brandon Clark
      www.themindspot.com

      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