title: How to cancel long-running QSqlQuery?
body: <p>How to cancel long running QSqlQuery?</p>
  
  <p>Database is returning 3M+ rows and it's shown in QTableView control. I'd like to be able to force stop both long operations:</p>
  
  <ol>
  <li>when database is running a long operation</li>
  <li>if database is fast, but there is a huge number of rows to be returned and processing/copying/showing those takes a lot of time</li>
  </ol>
  
  <p>2nd bullet, can be solved by not using QSqlQueryModel. In this case, parsing query results manually can be done in stages and this will be implemented, but i'd also like to know if the process of moving data DB->QTableView can be interrupted and cancelled.</p>
  
  <p>I've tried following without success:</p>
  
  <ul>
  <li>QSqlQuery::finish()</li>
  <li>QFuture::cancel()</li>
  <li>QSqlDatabase.close() -- this one crashes application</li>
  </ul>
  
  <p>If full context is needed, it's <a href="https://github.com/mispp/goat/blob/master/ui/QueryTab.cpp" rel="nofollow noreferrer">here</a>. Method in question is </p>
  
  <pre><code>on_button_stopQuery_released
  </code></pre>