title: Convert QSqlQueryModel Data into QVector(s)
body: <p>If we get data from an SQL database using the following QT functionality</p>
  
  <pre><code> QSqlQueryModel *model = new QSqlQueryModel;
   model-&gt;setQuery("SELECT name, salary FROM employee");
  </code></pre>
  
  <p>it states in the accompanying material we can access individual elements using either of the following commands</p>
  
  <pre><code> int salary = model.record(4).value("salary").toInt();
  </code></pre>
  
  <p>or</p>
  
  <pre><code> int salary = model.data(model.index(4, 2)).toInt();
  </code></pre>
  
  <p>and that we can insert this data into a QTableView using</p>
  
  <pre><code> QTableView *view = new QTableView;
   view-&gt;setModel(model);
  </code></pre>
  
  <p>And that this data can also be However, I can see anywhere how to extract a whole column of data or range of columns / rows (or as in the terminology of QSqlQueryModel index &amp; roles).</p>
  
  <p>Ultimately what I would like to do is efficiently extract parts of the data into either QVectors e.g column 3 of the data. or possibly into a matrix library such as armadillo or Eigen using some sort of getDataFunc(QVector rows, QVector columns).</p>
  
  <p>The data I am working is can be huge, so efficiently is important and thus using a naive set of for loops seems a very bad idea.</p>
  
  <p>Any help much appreciated.</p>