title: How to increase stack size for a thread in Qt - QThread::setStackSize() seems not to work?
body: <p>From the question: <a href="https://stackoverflow.com/questions/22576958/sqlite-stack-overflow-when-running-a-bulk-insert-with-500-rows-why">SQLite stack overflow when running a bulk INSERT OR REPLACE with 500 rows: why?</a>, I need to increase the stack size for a certain thread in Qt.</p>
  
  <p>I would like this to be cross-platform, but I am initially starting by trying to get it working on Windows.</p>
  
  <p>Unfortunately, nothing I have tried to do successfully increases the stack size for the thread in question.  (I measure the stack size by adding code to evaluate the current stack size (see link above), and observing that a stack overflow crash occurs at 1 MB, which does not reflect the stack size I am trying to set.)</p>
  
  <p>I have tried the following things:</p>
  
  <p>In Qt's <code>.pro</code> file for the project:</p>
  
  <pre><code>QMAKE_CXXFLAGS += /F 32000000
  QMAKE_LFLAGS   += /STACK:32000000
  </code></pre>
  
  <p>In the source code, the line before the <code>QThread::start()</code> function is called on the thread:</p>
  
  <pre><code>work_queue_manager_thread.setStackSize(static_cast&lt;uint&gt;(stackSize));
  </code></pre>
  
  <p>(where <code>work_queue_manager_thread</code> is the <code>QThread</code> instance, and <code>stackSize</code> is 32000000).</p>
  
  <p>I have tried both of the above attempts individually, and I have tried them together.  The result is the same: the stack size remains at 1 MB for the thread in question.  It does not reflect my desired stack size.  I am unable to set the stack size for my Qt thread.</p>
  
  <p>How do I <em>actually</em> set the stack size for a Qt thread to 32000000 - and in a way that works across Windows and OS X?</p>
  
  <p>Thanks.</p>