title: How to get a column from an sql table after running query
body: <p>i have recently been writing a program for a simple login window as a part of a project i have been working on. I have an SQL database structured as follows:</p>
  
  <pre><code>User:    
   __________________________________________
  | id | name | username | password | status |
  | ___+______+__________+__________+________|
  | 1  | niko | ******** | ******** | admin  |
  | 2  | andy | ******** | ******** | user   |
   ------------------------------------------
  </code></pre>
  
  <p>and a few more columns that go on like that.
  I have prepared an sql query in c++ in QTcreator as follows:</p>
  
  <pre><code>qry.prepare("SELECT name FROM Database.User WHERE username = :username AND password = :password")
  </code></pre>
  
  <p>which ideally is supposed to get either niko or andy or any other name for a given password and username. The only problem is i am not sure how to work with it. I have read the QT documentation multiple times and haven't found any way of obtaining the name as a string. I have tried to print it using:</p>
  
  <pre><code>qDebug&lt;&lt;qry.result()
  </code></pre>
  
  <p>however that only returns "0x5561eb32d240" I am not sure on what this is? Qt hasn't documented result() and the only thing i know about the return of result is that it is a const QSql type.</p>
  
  <p>Any ideas on how may i be able to return name as a string for later use?</p>